2017-09-14 64 views
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.inimemory_limit 2048M後進行測試。但仍顯示相同的錯誤。

對此問題的任何建議。

+2

錯誤提示128M的內存限制仍然存在,我會調查爲什麼你的設置不適用。 – flauntster

+0

您是否使用命令「service apache2 restart」或「service nginx restart」重新啓動服務器? –

+1

我不會全局增加內存限制,它可以防止流氓或bug的腳本導致DoS。反而增加它只是爲了你的一個用例,即:'php -d memory_limit = 2048M/path/to/composer update' – Geoffrey

回答

1

這是內存限制問題。 可以使用波紋管命令

$>which composer 
/usr/local/bin/composer 

嘗試這樣的事情

拳頭找到作曲家目錄後,您可以使用內存限制更新作曲家

$>php -d memory_limit=-1 /usr/local/bin/composer update 

-1意味着無限的內存

相關問題