I have an issue whereby occasionally a script that I run (which has dependencies on other websites) hangs trying to retrieve elements from these other websites if there is no response. I appreciate that I need to look at this part of the code again.
But, in the meantime, I want to understand why these commands that I have tried and put at the top of my PHP code are not working?
ini_set('max_execution_time', 30);
set_time_limit(30);
The scripts are run entirely in PHP and executed as CLI PHP (not as web pages launched from a browser) as :
php /var/www/html/client/index.php
The scripts execute fine, but if one of them hangs, it gets stuck as a process (as viewed via TOP
or HTOP
) and uses resources while it tries to execute and never closes.
Is there any other way to force the scripts to stop and close other than what I have already tried?
Thank you.