cancel
Showing results for 
Search instead for 
Did you mean: 

Composer Fails to install anything (locked at 2.2.6, required as 2.3.0)

Composer Fails to install anything (locked at 2.2.6, required as 2.3.0)

When I try to install anything, I get the following error:

 

  Problem 1
    - The requested package magento/product-community-edition (locked at 2.2.6, required as 2.3.0) is satisfiable by magento/product-community-edition[2.2.6] but these conflict with your requirements or minimum-stability.
  Problem 2
    - The requested package friendsofphp/php-cs-fixer (locked at v2.2.20, required as ~2.10.1) is satisfiable by friendsofphp/php-cs-fixer[v2.2.20] but these conflict with your requirements or minimum-stability.
  Problem 3
    - The requested package sebastian/phpcpd (locked at 2.0.4, required as ~3.0.0) is satisfiable by sebastian/phpcpd[2.0.4] but these conflict with your requirements or minimum-stability.
  Problem 4
    - Installation request for magento/product-community-edition 2.3.0 -> satisfiable by magento/product-community-edition[2.3.0].
    - magento/product-community-edition 2.3.0 requires php ~7.1.3||~7.2.0 -> your PHP version (5.4.16) does not satisfy that requirement.
  Problem 5
    - amzn/amazon-pay-and-login-with-amazon-core-module 2.1.0 requires php ~7.0.13|~7.1.0 -> your PHP version (5.4.16) does not satisfy that requirement.
    - amzn/amazon-pay-and-login-with-amazon-core-module 2.1.0 requires php ~7.0.13|~7.1.0 -> your PHP version (5.4.16) does not satisfy that requirement.
    - amzn/amazon-pay-and-login-with-amazon-core-module 2.1.0 requires php ~7.0.13|~7.1.0 -> your PHP version (5.4.16) does not satisfy that requirement.
    - Installation request for amzn/amazon-pay-and-login-with-amazon-core-module (locked at 2.1.0) -> satisfiable by amzn/amazon-pay-and-login-with-amazon-core-module[2.1.0].

I assume some of it is a result of a failed 2.3.1 upgrade. (I tried to get help here, but no one will help). I've given up trying to complete this upgrade from 2.2.6 to 2.3.1. How can I roll this back?

 

Also, My website and php -v is 7.1.30, but composer keeps trying to use php 5.4.16. How can I tell composer to use a different version of PHP? I know I can use the switch --ignore-platform-reqs, but I'd just like it to work.

5 REPLIES 5

Re: Composer Fails to install anything (locked at 2.2.6, required as 2.3.0)

Hi @Goad,

If you trying to upgrade into Magento 2.3, then PHP 7.2 is required.

If you have setup multiple php on the server then you need to give php7.2 path during command execution.

For example:

/usr/bin/php7.2 bin/Magento

/usr/bin/php7.2 is path where your php is installed on the server.

For Magento 2.3 system requirements you can follow magento docs.

https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements.html

I hope it will help you!

Re: Composer Fails to install anything (locked at 2.2.6, required as 2.3.0)

I already do that for bin/magento....but how do you specify which php version to use with composer? Either way, that was not my issue with my upgrade failure.

 

Also, my main question is how to I fix this?

 

- The requested package magento/product-community-edition (locked at 2.2.6, required as 2.3.0) is satisfiable by magento/product-community-edition[2.2.6] but these conflict with your requirements or minimum-stability.

 

Re: Composer Fails to install anything (locked at 2.2.6, required as 2.3.0)

It seems impossible to get basic support around here. Anyone have any suggestions where I can get some help?

Re: Composer Fails to install anything (locked at 2.2.6, required as 2.3.0)

Hi,

php7.1 will do fine for upgrade and there is some nice documentation on this in Magento's docs on this: https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html

 

but I myself prefer to use the 6 steps listed in

https://magento.stackexchange.com/questions/251778/how-to-upgrade-magento-version-from-2-2-x-to-2-3-...

 

Step 1: Backup code and database

Step 2:

composer require magento/product-community-edition=2.3.3 --no-update

Step 3:

composer require --dev phpunit/phpunit:~6.2.0 friendsofphp/php-cs-fixer:~2.10.1 lusitanian/oauth:~0.8.10 pdepend/pdepend:2.5.2 sebastian/phpcpd:~3.0.0 squizlabs/php_codesniffer:3.2.2 --no-update

 Step 4:

composer remove --dev sjparkinson/static-review fabpot/php-cs-fixer --no-update

Step 5 is often forgotten and I think quite important:

open composer.json file and add this "Zend\Mvc\Controller\": "setup/src/Zend/Mvc/Controller/", around line 47 under psr-4 section.

Note it would look something like :

"autoload": {
"psr-4": {
"Magento\\Framework\\": "lib/internal/Magento/Framework/",
"Magento\\Setup\\": "setup/src/Magento/Setup/",
"Magento\\": "app/code/Magento/",
"Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
},

(note the last line above saying Zend\\... that is new)

Step 6:

composer update

 

That should do it! I did encounter some issues during updates with customers where composer update got stuck on weird (or old module) lines in the composer.json so check your composer.json thoroughly! Do give the composer update enough time (because this is a big update!) and if it really really gets stuck (say like after 10 minutes) try running it in verbose to see what the problem is:

composer update -vvvv

 Good luck!

Re: Composer Fails to install anything (locked at 2.2.6, required as 2.3.0)

@Goad  
you can set the path of php using this command
export PATH=/opt/plesk/php/7.2/bin:$PATH 
after this command u can run your composer

if it work accept this as solution and give kudos