My php script is killed automatically by the OS (DEBIAN)

拜拜、爱过 提交于 2019-12-25 05:00:30

问题


I have a php script that is killed after 10 minutes by the OS (debian)

I don't want it to be killed

Someone told me that my server maybe has a task monitor that kills long-running processes as a safeguard against lockups.

I don't know how to access to the task monitor and how to disable it


回答1:


What Apache error log says?

If you have error:

Fatal error: Maximum execution time of ...

then you have to turn off limit for PHP script execution time, which can be set like this:

set_time_limit(0); // limit in seconds, 0 for unlimited

while (1)// test loop
{
    $a = 0; 
}

You may set this an option in php.ini file, its max_execution_time.



来源:https://stackoverflow.com/questions/15146687/my-php-script-is-killed-automatically-by-the-os-debian

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!