PHP update page

I am currently having a problem with GoDaddy and its hosting. The maximum time taken to run the PHP script is set to 120 seconds = 2 minutes.

Sometimes, when I run my script, it takes more than 120 seconds, and sometimes it takes 30 seconds.

When it takes more than 120 seconds, I get Internal Server Error (500).

I have a question: is it possible to calculate the execution time of the script by 110 seconds and then refresh the page so that the Internal Server Error does not execute.

+5
source share
1 answer

If what ever made your script run for a long time is some kind of standalone lock function (like querying a database), then you're disgusting.

, , , .

script : $t_start = time();

$runtime = time() - $t_start;, , , , , 120.

+2

All Articles