Forum Moderators: coopster

Message Too Old, No Replies

problem with a long running php script

it quits for no apparent reason....

         

Algebrator

3:59 pm on Jan 25, 2006 (gmt 0)

10+ Year Member



I have a PHP script that is supposed to run for a long time (appx 20 hours) , but it simply quits for no apparent reason after several hours (sometime after 5 hrs, sometime after 10...). Script is running on shared hosting (I tried several hosts - same result) It is not the CPU usage issue - there is a lot of 'sleep time', waiting for http requests; not much processing. Somebody on the forum briefly mentioned that running such long scripts is not good, but no reasoning was given. Is this really so, and if it is why?
If this is not good to do in principle, I will probably have the script modified so it runs a series of smaller cron jobs, but I would first like to know if this really is the problem.
I appreciate any help you could give me.

hutchic

9:38 pm on Jan 25, 2006 (gmt 0)

10+ Year Member



[ca3.php.net...]

May I ask exactly what is this script doing that requires 20hrs of execution time?

I'm under the impression that executing a script for so long isn't advised although I couldn't think of the reasoning why.... makes me wonder?¦

Algebrator

11:03 pm on Jan 25, 2006 (gmt 0)

10+ Year Member



I am doing some backlink checking in G,Y and MSN for a large number of expiring godaddy and snapnames domains, with long 'sleep times' in between so that I don't cause a ban

jackvull

10:43 am on Jan 26, 2006 (gmt 0)

10+ Year Member



Why not use a bit of javascript to refresh the page after a certain amount of time.
That way the script will run for say x seconds, the Javascript takes over what yuo were doing with the PHP sleep function.

drogyn

11:18 am on Jan 26, 2006 (gmt 0)

10+ Year Member



Is the max_execution_time value in your PHP.ini set high enough?

If it is, maybe the script fills up the internal memory too fast. This could be the case if you neglect to free objects after you're done with them.

Just some thoughts.

--Drogyn