I rebuilt PHP last night to include APC and all of a sudden composer stopped working in my project. Whenever I ran a simple update, install or dump-autoload I’d get:
1 2 3 4
It seems that there’s a bug between composer.phar and APC. From one of the composer issues:
Quite weird, but then again the php docs seem to acknowledge that APC should not really be enabled on the CLI. It seems to be a phar+apc bug, see https://bugs.php.net/bug.php?id=59398 https://bugs.php.net/bug.php?id=59829 https://bugs.php.net/bug.php?id=59907 as well.
There are a couple of things you can do to fix this, but they all involve turning off APC for php-cli. First, run composer diag to see whether any more information can be gleaned:
1 2 3 4 5 6 7 8 9
If you get that message, you know you have the same problem as I did :) You can also check the troubleshooting page on getcomposer.org
You can try running the self-update (for me I don’t reference the .phar file because I use the unix install convention).
Those are really just everyday things to try if you have composer issues, to really fix this you need to disable APC for php-cli. You should set this option to 0 in your php.ini
If you don’t have access to php.ini, you can disable APC on the CLI per command:
Note: if you have composer.phar in your project you could just do: