문제

I have a php applicacion to repair. The boss's solution is to restart the server each time the app fails. He wants to run a script when the page spends 30 seconds or more loading. How can I run the script when the execution time is up to 30s? Thanks in advance.

도움이 되었습니까?

해결책

I believe you should be able to use register_shutdown_function

set_time_limit(1);

function test() {
    echo "Processing timeout";
}

register_shutdown_function('test');

while(1);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top