Run PHP scripts in background for SSH or PHP 4 ... 12 hours?
Posted: Mon Apr 03, 2006 12:43 pm
Hey guys....
how would I go about doing this....
say I have a php script that runs for 12-24 hours when running in shell.....
i had ignore_user_abort(1) set and set_time_limit(0) in place, i just don't think it finished.
so my question is... how can i have it so my php script, we use call the script from http, and input the vars and click go, and it STARTS, but the browser doesn't like keep going for 12 hours, you know the browser will crash after like 6 hours usually for me or times out after 3-4 hours, even with flush() and echoing a "." every once in a while to keep the browser alive.....
I want to be able to simply start the php script from php and it goes but i can close the browser without any worries, or go to other pages on the script, ( this is the import page i'm talking about, it imports data for 12 hours or more depending on how big the file is ).
Is that possible to do that part from the browser to call it and it runs, and it would be nice if i could see if it's already running ( monitor it's progress every once in a while), and also prevent another copy of the import from running if called again and it's already running....
how would I go about doing this....
say I have a php script that runs for 12-24 hours when running in shell.....
that is how I do it now. it was going for 12 hours and then my isp started having problems for an hour and I got really bad latency, and the ssh stopped.... so I think that cancelled the php script yes?
/usr/bin/php /path/to/php/script.php 'whatever=vars&etc=etc'
i had ignore_user_abort(1) set and set_time_limit(0) in place, i just don't think it finished.
so my question is... how can i have it so my php script, we use call the script from http, and input the vars and click go, and it STARTS, but the browser doesn't like keep going for 12 hours, you know the browser will crash after like 6 hours usually for me or times out after 3-4 hours, even with flush() and echoing a "." every once in a while to keep the browser alive.....
I want to be able to simply start the php script from php and it goes but i can close the browser without any worries, or go to other pages on the script, ( this is the import page i'm talking about, it imports data for 12 hours or more depending on how big the file is ).
Is that possible to do that part from the browser to call it and it runs, and it would be nice if i could see if it's already running ( monitor it's progress every once in a while), and also prevent another copy of the import from running if called again and it's already running....