Home apache How to extend the execution time of a php script?

How to extend the execution time of a php script?

Author

Date

Category

I have a script and it takes a long time to execute.
In total, 30 seconds are given by default, this is stated in the logs.

[Thu Nov 10 00:07:48 2011] [error] [client 127.0.0.1] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/xxx/SOM.inc on line 291


Answer 1, authority 100%

Perhaps set_time_limit .


Answer 2, authority 67%

In php.ini, write:

max_execution_time = 60

Answer 3, authority 50%

Try it in php
php ini_set ("max_execution_time", "60");


Answer 4, authority 17%

To increase the running time of the script, write this at the beginning of the code (where the numbers are the script execution time in seconds)

ini_set ('max_execution_time', '600');

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions