Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) Laravel

I have a problem with Laravel . after restart my system, My project will not run !!!

I run with php artisan serv , but I have below messages in console :

[Tue Jul  3 14:31:35 2018] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /laravel-projects/blog/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 122
[Tue Jul  3 14:31:35 2018] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /laravel-projects/blog/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php on line 46
[Tue Jul  3 14:31:38 2018] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /laravel-projects/blog/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 122
[Tue Jul  3 14:31:39 2018] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /laravel-projects/blog/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php on line 46
[Tue Jul  3 14:31:39 2018] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /laravel-projects/blog/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 122

Before the system was restored, the project was well implemented !!

like image 265
Mostafa Norzade Avatar asked Jul 03 '18 10:07

Mostafa Norzade


2 Answers

This means you need to also update your php.ini memory_limit directive.

Try put in your php.ini :

memory_limit=1024M and restart apache :

sudo systemctl restart httpd.service

like image 184
Alihossein shahabi Avatar answered Sep 28 '22 08:09

Alihossein shahabi


Change in php.ini which is there inside apache2 folder

memory_limit=1024M

restart apache2

you can even check which php ini config is using by:

php -i | grep "php.ini"
like image 22
Harshavardhan Avatar answered Sep 28 '22 10:09

Harshavardhan