PHP set_time_limit() does not work, safemode is off

后端 未结 1 1964
梦毁少年i
梦毁少年i 2020-12-11 11:11

I try to disable the time limit in an PHP script by

set_time_limit(0);

but it does not work; the script is still aborted after the system d

相关标签:
1条回答
  • 2020-12-11 11:29

    I was able to solve the problem now. The reason was

    php_admin_value max_execution_time "30"
    

    ... within the virtual host configuration. If set there, the time limit cannot be overridden by a PHP script. And the solution is to set it either in the php.ini instead of Apache config - that allows override ...

    max_execution_time = 30
    

    or to define exceptions for certain directories within the apache config, e.g.

    <Directory /path/to/my/scripts>
      php_admin_value max_execution_time "600"
    </Directory>
    

    I also tried to define exceptions for single files using the <Files> directive, but that did not work.

    0 讨论(0)
提交回复
热议问题