1

I have updated my php from version 7.3 to 7.4.
command php -v is showing PHP 7.4.12 (cli) (built: Oct 29 2020 18:37:21) ( NTS )

but when i run laravel new [projectName] --jet, the laravel project created is with older php version which is 7.3. I tried composer global update and composer global install but the response was Nothing to install, update or remove. The issue is how to generate a new laravel project with php 7.4.

The issue relates to creating new project and not installing laravel(that's the difference between this question and the possible duplicates being marked)

Regards

Ashutosh
  • 107
  • 1
  • 5
  • Does this answer your question? [Getting old php version while installing Laravel](https://stackoverflow.com/questions/50132331/getting-old-php-version-while-installing-laravel) – Nico Haase Nov 01 '20 at 13:40
  • 1
    On your `composer.lock` change `"platform": {"php": "^7.3"},` to `""platform": { "php": "^7.4"},` then run `composer install` , enjoy – STA Nov 01 '20 at 15:10
  • in my composer.lock, "platform" is like :[], also in my composer.lock, in top this is where php version is being defined: "require": { "illuminate/contracts": "^8.0", "php": "^7.3|^8.0", "psr/container": "^1.0" – Ashutosh Nov 01 '20 at 17:40

1 Answers1

0

You need to update the laravel installer, for example:

composer global require "laravel/installer:^4.0"
Rok Sprogar
  • 2,261
  • 2
  • 17
  • 27