admin管理员组文章数量:1122832
I'm using PHP 8.2.12 and Laravel 9.52.16, and even setting max_execution_time to 300, restarting XAMPP, and restarting the computer, if the project takes more than 60 seconds to load, the maximum execution time error occurs. How do I fix this?
P.S.: I'm using a localhost project
I'm using PHP 8.2.12 and Laravel 9.52.16, and even setting max_execution_time to 300, restarting XAMPP, and restarting the computer, if the project takes more than 60 seconds to load, the maximum execution time error occurs. How do I fix this?
P.S.: I'm using a localhost project
Share Improve this question asked Nov 22, 2024 at 15:09 Alexandre Santos GomesAlexandre Santos Gomes 112 bronze badges 2 |2 Answers
Reset to default 0- Set excution_time at PHP config file
- Set excution_time at Xampp server
- Sometimes your brower will close automatically when request take time is too long -> use
curl, postman
to send request, or think aboutqueue
in laravel
You need to do more steps to figure out if it not working even after changing the MAX_EXECUTION_TIME value.
- As you are using Laravel so use the following code in your /routes/web.php file:
Route::get('/phpinfo', function () {
return phpinfo();
});
Then, test this above added route like (modify it according to your url and port:
http://locahost:8000/phpinfo
- Look for the "Loaded Configuration File" to confirm the active php.ini path and change the value of
max_execution_time = 300
After you have done the changes in php.ini file, you must restart your XAMPP server.
- To identify the active value of max_execution_time use the following code:
dd(ini_get('max_execution_time'));
- The Apache server might have a timeout configuration that overrides PHP's max_execution_time. You need to locate your Apache configuration file according to your operating system
Windows:
xampp\apache\conf\httpd.conf
or
xampp\apache\conf\extra\httpd-xampp.conf
Search for the Timeout directive and set it to a higher value:
Timeout 300
Also restart Apache.
The above steps will help you to fix this MAX_EXECUTION_TIME issue.
本文标签:
版权声明:本文标题:php - Laravel reporting error in Maximum execution time of 60 seconds exceeded even with max_execution_time in 300 - Stack Overf 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736302881a1931692.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
phpinfo()
through Laravel and check: 1) What INI files are parsed 2) What values formax_execution_time
are reported. – Álvaro González Commented Nov 25, 2024 at 9:38