Answer the question
In order to leave comments, you need to log in
Why does the php script on the hosting work for the first few seconds and then turn off?
Hello!
I launched a script with an eternal loop on a free hosting (that is, I opened a new tab and went to my site where the code itself was) that wrote data to a file, then closed the tab and the script worked fine for the first few seconds, but then stopped, sorry for the noob question, but how can this problem be solved?
Thank you
Answer the question
In order to leave comments, you need to log in
Run it in the console, you won't be able to bypass system variables for timeouts
You have encountered a timeout: php.net/manual/ru/function.set-time-limit.php
You can try to specify , but this is not entirely correct set_time_limit(0)
We treat infinity through set_time_limit(0)
Closing the browser through ignore_user_abort
But if ngix is installed, then it also has limitations and it will cut down your script, giving a 503 error.
Try to start by just looking in the browser what will happen after a minute, after 15 minutes. Will work or not.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question