Search code examples
phplaravellaravel-5

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 !!


Solution

  • 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