Composer requires php version 7 ->

check composer-php version
composer ignore php version
composer using wrong php version
how to update php version in laravel
composer download
composer require multiple versions
reinstall composer
downgrade composer version

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

you can skip platform check with this:

composer install --ignore-platform-reqs

otherwise you can run:

php composer.phar install

to use the php exetutable that you prefer

Composer update fails with composer.json php version set to 7.1 , Problem 1 - This package requires php 7.1.* but your The PHP version in your composer.json file is there JUST to limit what versions can run your project. homestead-7: Checking if box 'laravel/homestead' is up to date. When you run composer update the next time, you'll automatically receive updates for the packages mentioned above, provided that you are running on PHP 7.1. If you are running an older PHP version, composer will not install a version that requires PHP 7.1, since its requirements are not fulfilled. A common problem is people running a newer PHP

As and alternative you can also use docker image of composer:

docker run --rm --interactive --tty \
  --volume $PWD:/app \
  composer install

Composer is not recognizing PHP 7, A package that you use, or your own software itself, explicitly requires a PHP 5.x version ( ~5.4 ), with x being at least 4, or higher (i.e. it would  For example, you may be using an up to date version of PHP 7 locally, but deploy to a server still using 5.6. Another way of setting this is from the command-line. composer config platform.php 5.6.1. This will set the platform option in the composer.json file for us. In this example it would add PHP 5.6.1 to the JSON file just like in the previous example.

Let Composer know the version of PHP you are using in your Laravel app by including a platform key in the config section of your composer.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:

{ 
    "name": ".../...", 
    "config": { 
        "platform": { 
            "php": "7.1.3" 
        } 
    }, 
    "require": {
        ... 
    } 
}

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 the require key is the minimum php requirement for your application.

Enforcing a PHP Version for Installed Composer Packages, We can tell Composer what version of PHP we are supporting with our For example, you may be using an up to date version of PHP 7 package that requires a minimum of PHP 7.1.0 the composer.json file would look like:- When I run this command: Composer install / composer update I get this output: This package requires php 7 but your PHP version (7.0.8) does not satisfy that requirement.

run composer with php 7.1 instead of php 5.6 / Community Support , to the next version of laravel framework, this new versions required php 7. So i need some help to change de default path of php version to run composer,  Click on the Pathrow under 'System variables', and click 'Edit'. Click 'New' and add the row C:\PHP7. Click OK, then OK, then OK, and close out of the System Control Panel. Open PowerShell or another terminal emulator (I generally prefer cmder), and type in php -vto verify PHP is working.

Composer, travis-ci Zend and php versions 7.0 - 7.2, Until recently, my composer.json has been requiring php version 5.6 doctrine/​cache v1.8.0 requires php ~7.1 -> your PHP version (7.0.25)  composer require --dev phpunit/phpunit-selenium Using version ^7.0 for phpunit/phpunit-selenium./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

Can't install because php 7.2 is required by doctrine/lexer, doctrine/lexer 1.1.0 requires php ^7.2 -> your PHP version (7.1.32) does not in the composer.json file it species either php 5.6 or 7.0 not 7.2  If anyone is still having trouble, remember you can run composer with any php version that you have installed e.g. $ php7.3 -f /usr/local/bin/composer update Use which composer command to help locate the composer executable.