skip to Main Content

My host updated composer version ( 2.2 ) without updating php version ( 7.0.33 ).

When I run composer [command], I get this error:

Composer 2.3.0 dropped support for PHP <7.2.5 and you are running 7.0.33-0+deb9u12, please upgrade PHP or use Composer 2.2 LTS via "composer self-update –2.2". Aborting.

I don’t have the option to downgrade composer (composer self-update --2.2 give me the same ) and this php version is locked.

So I decided to use /opt/plesk/php/7.4/bin/php /usr/lib/plesk-9.0/composer.phar [command] instead and it works. I think php /usr/lib/plesk-9.0/composer.phar will work too.

I’m using Symfony 4 and now I need to deploy my application. But when I try php bin/console doctrine:schema:update --dump-sql composer detect issues because my dependencies require a higher php version than defined in var

PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.2.5". You are running 7.0.33-0+deb9u12. in /var/www/vhosts/client-name/httpdocs/vendor/composer/platform_check.php on line 24

First question: Why composer is called when I try to update my database using doctrine CLI?

What I tried

I run composer config platform.php 7.0.33
Some of my dependencies are now too new, so I’m trying to downgrade them to the latest major version.

I changed the version of PHP and in libraries in the "require" section and I run /opt/plesk/php/7.4/bin/php /usr/lib/plesk-9.0/composer.phar update --with-dependencies ( because just composer cause me problems )
It doesn’t work for doctrine which need PHP 7.1 and I don’t want to go back to doctrine 1 ( doctrine 2.0 was released in 2010 )

Second question: Do you have any suggestion? I don’t see an immediate solution

2

Answers


  1. Chosen as BEST ANSWER

    If you have the same problem than me, you may need to call symfony command using PHP binaries directly:

    /opt/plesk/php/7.4/bin/php bin/console d:s:u --dump-sql


  2. I had the same issue and I had to upgrade PHP by running:

    $ brew unlink [email protected]

    $ brew link [email protected]

    Hope that can help someone.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search