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

eddy1992's avatar

Installing Laravel 6

I want to install Laravel latest version. So I am using the following command -:

composer create-project --prefer-dist laravel/laravel public/

The problem is that it keeps on installing Laravel version 5.8.35.

Installing laravel/laravel (v5.8.35)
  - Installing laravel/laravel (v5.8.35): Loading from cache

Now my php cli version is PHP 7.3.11 and php info also shows the same but it still installs 5.8.35

So I was trying to fix this issue by running -:

composer create-project laravel/laravel public/ "6.*"

and it gave me the following error -:

[InvalidArgumentException]                                                                                       
  Could not find package laravel/laravel with version 6.* in a version installable using your PHP version 7.1.33.  
                                                                                        

Please assist me in installing the latest Laravel version.

Thank you

0 likes
9 replies
Nakov's avatar

@eddy1992 what operating system are you using?

Does running php -v also shows 7.3.11?

Nakov's avatar

@eddy1992 try composer global update so that the laravel installer gets updated as well.

Snapey's avatar

Nakov suggested updating composer, not the installer

Clearly composer thinks your PHP is 7.1. You need to track down the reason for that

Nakov's avatar

@eddy1992 and why not install the laravel installer and try creating a project like laravel new project_name. Or just close your terminal and open it again in case it keeps the old session for some reason which does not make sense as you said that PHP version is the new one, if you tried that in the same window.

Please or to participate in this conversation.