开发者

Fatal error: Maximum execution time of 400 seconds exceeded

I have a PHP script that fails when executing a long mysq_query. The error mess开发者_如何转开发age is:

Fatal error: Maximum execution time of 400 seconds exceeded in....

I use XAMPP for windows and I have changed the php.ini file (there is only one in my installation), setting max_execution_time to a large value that is not 400 seconds. Nevertheless I keep getting the error message above....

Any idea of how to solve this?

Thanks

Beto


As Ignacio says, something may be overriding the php.ini setting. You can definitively set the timeout for that script using set_time_limit

set_time_limit(600);

You can also set it to 0, which removes any time restriction - although this is not best practice.

400 seconds is a huge amount of time for a query - have you looked into adding indexes on commonly used columns in your db?


You need to restart your web server for PHP to re-parse your config file.


Something in either a .htaccess file or within a PHP script is probably resetting it back to 400 seconds.

Having said that, 400 seconds is still an excessive amount of time for a query. You should consider farming the task off to another process if it really needs to take that long.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜