PHP set_time_limit() does not work, safemode is off

后端 未结 1 1969
梦毁少年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.

    
      php_admin_value max_execution_time "600"
    
    

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

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