I have uploaded my laravel project on a subdomain which requires php 7 and above. I have updated the subdomain to use php 7. However when run the composer install
, it says my php version is 5.6, which is the global version. In the project, i check the version php -v
and it shows the version as php v7
.
How come the composer is running with php version 5.6 ? Please help
3
Answers
you can skip platform check with this:
otherwise you can run:
to use the php exetutable that you prefer
As and alternative you can also use
docker
image ofcomposer
:Let Composer know the version of PHP you are using in your Laravel app by including a
platform
key in theconfig
section of yourcomposer.json
file and reinstalling composer.For instance, if you have the version of php7 as 7.1.3, you can update
composer.json
like this:Note: The the PHP version you provide with the
platform
key is the version of php for the environment where your app is installed, while the version you provide with therequire
key is the minimum php requirement for your application.