Вопрос

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