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

loquela's avatar

php -v = 7.0.12 but Composer Sees 5.5.30

Hi there, I'm using MAMP on MacOSX El Capitan I've set up a new laravel project and I'm trying to run composer install. However I'm getting the following errors: "Your requirements could not be resolved to an installable set of packages." "This package requires php >=5.6.4 but your PHP version (5.5.30) does not satisfy that requirement."

But: loquelas-iMac:laravel-project simonclegg$ php -v PHP 7.0.12 (cli) (built: Oct 24 2016 18:49:11) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

I'm not sure if this is related but I'm getting a blank page when I run a new laravel project an the error log is giving me: [10-Nov-2016 21:57:37 Australia/Sydney] PHP Warning: require(/Users/loquela/laravel-project/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/simonclegg/laravel-project/bootstrap/autoload.php on line 17 [10-Nov-2016 21:57:37 Australia/Sydney] PHP Fatal error: require(): Failed opening required '/Users/loquela/laravel-project/bootstrap/../vendor/autoload.php' (include_path='.:/Applications/MAMP/bin/php/php7.0.12/lib/php') in /Users/loquela/laravel-project/bootstrap/autoload.php on line 17

0 likes
2 replies
bobbybouwmann's avatar
Level 88

So there is a difference between the PHP version you run in your console (CLI) and the PHP version MAMP is using (CGI). You probably have installed php locally and also installed MAMP. This means your PC has two PHP versions.

You can either point MAMP to your PHP version or you can update MAMP and get the new php version as well: http://stackoverflow.com/questions/32413555/how-can-i-add-php-7-0-0-rc2-in-mamp

CLI vs CGI: http://stackoverflow.com/questions/9315714/what-is-difference-between-php-cli-and-php-cgi

loquela's avatar

Thanks @ bobbybouwmann,

MAMP's php default was also 7.0.12 and my host was running 7.0.12.

I'm not sure what going on here or how I've fixed it. But I got it working by running: composer create-project.

I'll try and reproduce the problem. But for now everything seems to be ok.

Thanks.

Please or to participate in this conversation.