Domanda

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.

È stato utile?

Soluzione

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);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top