Need Help: Persistant/Long running PHP scripts

0 views
Skip to first unread message

Scott

unread,
Oct 23, 2006, 11:00:17 PM10/23/06
to OC PHP
Most of my PHP coding has always been relatively small user scripts. I
now need to connect to a real estate database using RETS, I need to
pull listings and images and them save them in a db or flat files. My
concern comes into if I create such a script, have a cron run it every
day, what's to keep it from dying and failing if it takes too long to
complete all of the downloads? Does anyone know of a way to test for
this?

Message has been deleted

William Estrada

unread,
Oct 24, 2006, 5:57:08 PM10/24/06
to OC-...@googlegroups.com
You can't pull the list first to save to hard drive then process from there? This way you can flag when an item has been successful processed (images downloaded etc...). 

You might also want to look at the functions below. These however are useless if php is running in safe mode. Be sure to read contributor notes.

http://us3.php.net/manual/en/function.set-time-limit.php
http://us3.php.net/manual/en/ref.info.php#ini.max-execution-time

/*

set_time_limit
( int seconds )

Set the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error. The default limit is 30 seconds or, if it exists, the max_execution_time value defined in the php.ini . If seconds is set to zero, no time limit is imposed.

*/

Scott

unread,
Oct 27, 2006, 2:21:00 PM10/27/06
to OC PHP
Thanks! I'll look into it and see what I can figure out.

Reply all
Reply to author
Forward
0 new messages