Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SarahS's avatar
Level 12

Install old version of Laravel

I've started using Laravel 6 in my projects but since found out that the host I use for testing is still on 5.7. When I create a new project how can I install 5.7 and not 6?

0 likes
8 replies
bobbybouwmann's avatar

In general, it's better to create a new application from scratch and copy over all the controllers and views, etc. that you already created.

You can try to replace the ^6.3 in the composer.json file to ^5.7 and run composer update and see if that works. However, the first solution is probably the easiest.

1 like
vijith's avatar

@bobbybouwmann Hi, So for upgrading a laravel project from laravel version from 5.4 to 8, the best way is to create a new project on laravel version 8 and then copy the controllers,views and other required files and then make the code changes to support the latest packages (eg: Carbon 1 to the latest Carbon) ? Or the better option is to follow the upgrade guide in laravel documentation ? (i.e 5.4 ->5.5->5.8-> ... ->8). Can you please suggest which is the better option.

tykus's avatar
tykus
Best Answer
Level 104
composer create-project --prefer-dist laravel/laravel blog "5.7.*"

Edit: wait, what does this matter?

found out that the host I use for testing is still on 5.7

3 likes
SarahS's avatar
Level 12

@tykus I don't know, it's just that my new Laravel 6 project wasn't working so I though it was because they still use 5.7. Does it not matter?

Sinnbeck's avatar

Most likely not. What version of php is the server running? Laravel 6 requires php 7.2 so if it is running 7.1, that might be the reason :)

tykus's avatar

Ok, @sarahs74 as @sinnbeck says, you are constrained not by the suggested Laravel version from the host, but by the PHP version(s) they support. You can check the server requirements for each Laravel version and see whether the latest version (or which previous version) can work for you

bobbybouwmann's avatar

LOLOLOL. This was your question...

When I create a new project how can I install 5.7 and not 6?

Please or to participate in this conversation.