6

Hello to all users of the forum, I need help.

I upgraded from version 2.3.2-p2 to 2.3.4 and after that the error is occurring:

composer update
Do not run Composer as root/super user! See https://getcomposer.org/root for details Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

 Problem 1  
    - friendsofphp/php-cs-fixer v2.13.3 requires php ^5.6 || >=7.0 <7.3 -> your PHP version (7.3.15) does not satisfy that requirement.  
    - friendsofphp/php-cs-fixer v2.13.2 requires php ^5.6 || >=7.0 <7.3 -> your PHP version (7.3.15) does not satisfy that requirement.  
    - friendsofphp/php-cs-fixer v2.13.1 requires php ^5.6 || >=7.0 <7.3 -> your PHP version (7.3.15) does not satisfy that requirement.  
    - friendsofphp/php-cs-fixer v2.13.0 requires php ^5.6 || >=7.0 <7.3 -> your PHP version (7.3.15) does not satisfy that requirement.  
    - friendsofphp/php-cs-fixer v2.13.3 requires php ^5.6 || >=7.0 <7.3 -> your PHP version (7.3.15) does not satisfy that requirement.  
    - Installation request for friendsofphp/php-cs-fixer ~2.13.0 -> satisfiable by friendsofphp/php-cs-fixer[v2.13.0, v2.13.1, v2.13.2, v2.13.3]

.

Anyone who can help me will be grateful.

Hugs

php-cs-fixer error

1
  • you have try php version downgrade with 7.1.3+ Commented Feb 28, 2020 at 15:44

6 Answers 6

10

1.composer require magento/composer-root-update-plugin=~1.0 --no-update

  1. open composer.json and change:

from - "friendsofphp/php-cs-fixer": "~2.xx.x",

to + "friendsofphp/php-cs-fixer": "~2.16.0",

3.composer update

4.php -f bin/magento setup:upgrade

4.1:create /data/web/magento2/var/composer_home composer.json with: {}

Change PHP version to php 7.3.x

5.composer require magento/product-community-edition=2.4.1 --no-update --use-default-magento-values

--use-default-magento-values is to change order if needed of:

  friendsofphp/php-cs-fixer,
  lusitanian/oauth,
  pdepend/pdepend,
  phpmd/phpmd,
  phpunit/phpunit,
  sebastian/phpcpd,
  squizlabs/php_codesniffer

5.composer update

  1. database upgrade to 5.7 then to 8.0

  2. php -f bin/magento setup:upgrade

8.happy days Upgrade to magento 2.4.x is done :)

6

The issue is that php-cs-fixer does not support PHP versions above 7.3. php-cs-fixee is only a dev dependencies though, that just fixes code style issues.

So if you are in a production environment you can simple not update / install the dev dependencies with the approripate command.

composer install --no-dev
composer update --no-dev

Or if you want access to these dev tools you can downgrade your PHP version to a support one such as 7.2.

Another option is you can remove the depency from the project in general with

composer remove friendsofphp/php-cs-fixer
3

Probably best idea is to fix it properly via sams answer but if it's something you just want to work around quickly you can also use

composer install --ignore-platform-reqs

which will ignore platform requirements during the installation

3

If you find yourself in this situation like I did it's possible you skipped the step in the cli upgrade process to update the additional packages. Please see the dev docs links:

https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html

In short the step "Specify Additional Packages" is what I missed which would've updated the additional packages including the friendsofphp/php-cs-fixer package using this piece of code

composer require --dev allure-framework/allure-phpunit:~1.2.0 friendsofphp/php-cs-fixer:~2.14.0 lusitanian/oauth:~0.8.10 magento/magento-coding-standard:~3.0.0 magento/magento2-functional-testing-framework:2.4.5 pdepend/pdepend:2.5.2 phpmd/phpmd:@stable phpunit/phpunit:~6.5.0 sebastian/phpcpd:~3.0.0 squizlabs/php_codesniffer:~3.4.0 --sort-packages --no-update

After that I was able to get my site working on php 7.3 without issues. I was just moving a little too fast.

1

This solution worked for me. First check which version of Php your SSH is using, type this on Debian/Ubuntu based servers :

php -v

It will confirm you're using Php 7.3.15. It's not right Php version to process those queries. For you case you need php 7.2 CLI, it's the command line interface you are using when you connect by SSH, not the one running Magento, they can be different. Make sure you have the right Php shell installed on your server. If not, install it. For Debian/Ubuntu based servers, type :

sudo apt-get install php7.2 php7.2-cli php7.2-common

Then, you need to be able to use the right php version for this particular query. Type the next query to use Php 7.2 temporarily, just for the actual session. If you disconnect, it will go back to the previous PHP Cli version. Type this query and make sur the link to you php folder is correct.

export PATH=/usr/local/php72/bin:$PATH;

For Plesk users

export PATH=/opt/plesk/php/7.2/bin:$PATH;
0

None of those solutions solved the problem.

The "no-dev" option doesn't update the dev packages, but it requires you to fix the issues anyway.

Removing php-cs-fixer will remove a lot of other dependencies. Then, it will throw another error related to magento2-functional-testing-framework which is also not compatible with PHP 7.3.15.

Removing both will finally allow you to run "composer update", but it will create issues on frontend.

I tried updating those packages to newer versions working with PHP 7.3.15. It is a real nightmare. It keeps leading to new issues related to other dependencies that you have to update as well. At the end, it will crash the system.

My best bet is to downgrade PHP temporarily, or wait for Magento 2.3.5 coming out this month.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.