0
这很令人困惑,为什么会显示此错误。我使用Laravel 5.4
,使用composer update
后显示此错误。关于Laravel允许的内存大小的PHP工匠“PHP致命错误”
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 495616 bytes) in E:\xampp\htdocs\botble\vendor\symfony\debug\ExceptionHandler.php on line 238
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in E:\xampp\htdocs\botble\vendor\symfony\debug\Exception\FlattenException.php on line 203
Script php artisan optimize handling the post-update-cmd event returned with error code 255
由于部分堆栈和其他社区的答案,我也更新php.ini
与memory_limit 2048M
后进行测试。但仍显示相同的错误。
对此问题的任何建议。
错误提示128M的内存限制仍然存在,我会调查为什么你的设置不适用。 – flauntster
您是否使用命令“service apache2 restart”或“service nginx restart”重新启动服务器? –
我不会全局增加内存限制,它可以防止流氓或bug的脚本导致DoS。反而增加它只是为了你的一个用例,即:'php -d memory_limit = 2048M/path/to/composer update' – Geoffrey