I have a very strange problem since yesterday. Running composer install on my production server causes this error ... Keep in mind that I am not getting any errors on my local server (Homestead VM).
Nothing to install or update Writing lock file Generating autoload files Executing command (CWD): php artisan clear-compiled Executing command (CWD): php artisan optimize Generating optimized class loader Compiling common classes Script php artisan optimize handling the post-install-cmd event returned with an error [RuntimeException] Error Output: Exception trace: () at phar:///home/site/public_html/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:177 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///home/site/public_html/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:91 Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///home/site/public_html/composer.phar/src/Composer/Installer.php:342 Composer\Installer->run() at phar:///home/site/public_html/composer.phar/src/Composer/Command/InstallCommand.php:131 Composer\Command\InstallCommand->execute() at phar:///home/site/public_html/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257 Symfony\Component\Console\Command\Command->run() at phar:///home/site/public_html/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:874 Symfony\Component\Console\Application->doRunCommand() at phar:///home/site/public_html/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:195 Symfony\Component\Console\Application->doRun() at phar:///home/site/public_html/composer.phar/src/Composer/Console/Application.php:146 Composer\Console\Application->doRun() at phar:///home/site/public_html/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:126 Symfony\Component\Console\Application->run() at phar:///home/site/public_html/composer.phar/src/Composer/Console/Application.php:83 Composer\Console\Application->run() at phar:///home/site/public_html/composer.phar/bin/composer:43 require() at /home/site/public_html/composer.phar:25 install [
So it seems that the error appears in post-install-cmd when php artisan optimize configured to run ... It is strange that when I run all post-install-cmd manually, I DO NOT get any errors.
So I tried:
composer selfupdate- Removing the composer and reinstalling it
- Using composer.phar instead of global
- Running
composer dumpautoload - delete
composer.lock file - delete the entire cache
composer clearcache composer update works, in production (frantically)
And still get the same error. Do you have ideas? I'm running out of keywords to find similar issues on the Internet.
Thank you so much
EDIT:
Also failed to mention that the site is working fine. There is no error viewing.
EDIT 2:
As suggested by @marcanuy, I tried to delete the vendor directory. So far, I have also cleared the compiled and composer cache. The composer re-downloaded / installed everything. And still get the same error.
EDIT 3:
So, I narrowed it down. I DIDN'T GET AN ERROR IF I SET APP_DEBUG to true ... When false, I get an error. Any idea why?
COMPLETION:
Thanks to Ben Johnson, who pointed me in the right direction ... I checked my raw PHP logs and yes, they are different from laravel logs (I must think about that). I saw there a strange memory error not related to the files in the error stack above:
[02-Jun-2015 14:05:01 Europe/Paris] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 64 bytes) in /vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php on line 169
After the moment tady. I raised memory_limit and composer install worked without errors, and disconnected with APP_DEBUG.
Thank you all for your help.
php laravel laravel-5 composer-php dev-to-production
Johnwolf
source share