Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix allowed memory size exhausted in Laravel?

Tags:

laravel

I am using Laravel 5.6 in windows 10. The database that I used is MySQL 8.0 . When i try to load web view from my browser, memory size exhausted error message occur in laravel log and does show anything in web view.

[Wed Dec 26 09:34:47 2018] PHP Fatal error:

Allowed memory size of 2097152 byte s exhausted (tried to allocate 4096 bytes) in D:\Project\Project-Serve\ven dor\composer\autoload_static.php on line 168

like image 240
Zin Myo Ko Avatar asked Oct 20 '25 14:10

Zin Myo Ko


2 Answers

Look up "etc/php/7.0/cli/php.ini" this directory. In the php.ini file change this:

; Old one
; memory_limit = 2048M

; New one
; memory_limit = 4096M
like image 156
Ali Özen Avatar answered Oct 23 '25 07:10

Ali Özen


Increase the memory_limit in php.ini file.

To know which php.ini is loading. use following command

php -i | grep "php.ini"

Restart web server.

like image 40
Sainadh Mannem Avatar answered Oct 23 '25 08:10

Sainadh Mannem



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!