2
votes

It has been a while since I created a new project with Laravel framework. Decided to install a fresh project so opened up V7 documentation at Install Via Composer Create-Project.

First updated my global Composer installation to the newest version: composer self-update

Then ran installation with composer create-project as exampled in the docs: composer create-project --prefer-dist laravel/laravel myproject

After installation went into the directory to check Laravel's version: cd myproject && php laravel -V

Much to my surprise it had installed a much older version: Laravel Framework 5.8.37

Expected to get the newest version... Why did it install an older version, and how do I upgrade or instruct the create-project command to use the newest version?

1
composer create-project laravel/laravel=YOUR_VERSION your-project-name --prefer-dist - Mate
Sorry but that question has different problem, as "when you run the above command, it will grab the latest version of Laravel." – I have the opposite situation, as I was expecting to get the newest version but got a really old one. - ux.engineer
What have you tried to debug the problem? - Nico Haase
Tried to see what global composer packages was installed but there was no global Laravel package installed. - ux.engineer

1 Answers

1
votes

It looks lile your environment is insufficient for L7 (like too old PHP version, missing required extensions etc). You should ensure your environment fulfills Laravel requirements:

  • PHP >= 7.2.5
  • BCMath PHP Extension
  • Ctype PHP Extension
  • Fileinfo PHP extension
  • JSON PHP Extension
  • Mbstring PHP Extension
  • OpenSSL PHP Extension
  • PDO PHP Extension Tokenizer PHP Extension XML PHP Extension

https://laravel.com/docs/7.x/installation#server-requirements

Also keep in mind that php-cli version you use may be different from what your httpd is using (i. e. due to $PATH and multiple PHP versions are installed).