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

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

Where can I increase the lead time?

    4 answers 4

    Perhaps set_time_limit .

    If set to 0, besides, the limit on the execution time of the script is completely absent.

      Register in php.ini:

      max_execution_time = 60 

      Only this is not a panacea - after 60 seconds some browsers break the connection, and then apache nails the process

        Try php php ini_set("max_execution_time", "60"); or .htaccess file -> php_value max_execution_time 60 .

          To increase the 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');