PHP is throwing the following error when trying to deploy with envoyer:
php artisan optimize
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in /home/forge/project/releases/20170327091815/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 621
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0
Script php artisan optimize handling the post-install-cmd event returned with error code 255
It fails on various commands and I can't replicate it reliably however it can sometimes be fixed by changing debug to true in the .env file.
AFAIK Laravel Framework dropping optimize command since 5.4.
Okay but the php artisan optimize command is still in composer.json scripts. I also get this error when calling other artisan commands such as "php artisan storage:link".
Check all your ServiceProviders. You might be calling $this->register where you're suppose to call $this->app->register() and, thus, causing infinite recursion.
@anewmanjones check your code for any recursive calls and update us :)
How can you fix this bug?
Most helpful comment
@anewmanjones check your code for any recursive calls and update us :)