简体   繁体   中英

PHP artisan "PHP Fatal error" on allowed memory size in Laravel

It's confusing, why this error shown. I'm using Laravel 5.4 , after using composer update then this error shown.

$ 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

As some of answer on stack and other community, i'm also test this after update php.ini with memory_limit 2048M . But still same error shown.

Any suggestion for this issue.

This is memory limit issue. You can try something like this

Fist find composer directory using bellow command

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

After you can update composer with memory limit

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

-1 means unlimited memory

In my case helped this

php -d memory_limit=1 artisan xxxxxxx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM