PHP and composer

Running php composer.phar with the latest version gives me:

 PHP Fatal error: Cannot redeclare class Symfony\Component\Console\Helper\Helper in phar:/composer.phar/vendor/symfony/console/Symfony/Component/Console/Helper/Helper.php on line 19 

What? It works fine locally, but on a Linux server.

This happens as soon as I try to run any commands or just a file directly. I can’t self-renew or anything else. I tried rebooting.

+4
source share
1 answer

Most likely you have apc.enable_cli set to 1, you can check with php -i | grep apc php -i | grep apc .

Another way to test everything in order to start the composer is to run the installer in test mode:

 curl -s https://getcomposer.org/installer | php -- --check 

APC is completely destroyed by PHAR (at least in CLI mode), and in any case, the CLI does not provide any caching, since each process is independent, so disabling it makes sense, the flag exists only for debugging AFAIK.

+8
source

Source: https://habr.com/ru/post/1439988/


All Articles