Page 1 of 1

PHP Script that last for a long time

Posted: Wed Jan 14, 2009 11:13 am
by svirid
Good day,

I am running a PHP script that parses csv files and inserts data into the table,
basically it handles about 2gb of files per day. I do have it scheduled every 5 min and handle only one file per request.

My question is how can I run it only once and make it run for a day or till the files are done.
I had it before but it was crushing from time to time. I guess my question would be, how can I free memory, any kind of memory_flush method?

I use usleep and sleep in order to to crush it but still...

Thank you.

Re: PHP Script that last for a long time

Posted: Fri Jan 16, 2009 8:25 pm
by svirid
Anybody?

Re: PHP Script that last for a long time

Posted: Sat Jan 17, 2009 2:56 pm
by josh
You need to get rid of max_execution_time and also make sure you're not getting killed due to memory usage,. I'd recommend proxying your command thru nohup to the PHP CLI for maximum longevity