I'm on shared hosting and constantly get over process limit errors. Support said if traffic is low then it's because inefficient scripts are not terminated. Since I'm on a shared host and I only create the .php files, I don't really get how my scripts which only serve pages (that is they are called by Apache when a request coming in and they create and display the page) could not terminate.
Is it possible a script can linger on even if it's finished its job? Is there a way to make a script terminate other than exiting when end of file is reached?
My scripts are regular PHP scripts, they fetch data from the database, create the HTML and then exit. They do not do anything special.
Your PHP Script is running in a Loop which creates the HTML.
Please paste some code so that we can investigate and help you out. At this time, this all I can say as mentioned above.
You can track down how long does it take for the script to run
<?php
/* Put this first thing before the loop begins */
echo "Start " . date("Y-m-d H:i:s");
?>
<?php
/* Put this at the end of your script */
echo "End " . date("Y-m-d H:i:s");
?>
You can setting set execution limit http://www.php.net/manual/en/function.set-time-limit.php
If you mean execute result set with big number data and don't want tobe terminated until all data get executed for example sending mail for each user in your database and wait till all user get mail then it can send new mail to that user you can use web cron instead http://www.mywebcron.com limit send email for 20 user only, and update it send status to true so it send only to false send status