CodeBriefly
CodeBriefly

Reputation: 1020

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.

Upvotes: 3

Views: 11219

Answers (2)

Ruslan Novikov
Ruslan Novikov

Reputation: 1527

In my case helped this

php -d memory_limit=-1 artisan xxxxxxx

Upvotes: 5

Yashvantsinh Zala
Yashvantsinh Zala

Reputation: 531

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

Upvotes: 3

Related Questions