My next question, is there any way to interact with php to determine which scripts are being run in any way? Yes Im praying for some magical technique..
Check running scripts
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Check running scripts
I have a script that will be run for about 5 hours, now I have set_time_limit(0) so I want to let it finsih, although even if I click the STOP button in my browser the script still seems to run. Anyone know how to prevent the script from continuing -- this is extremely annoiying 
My next question, is there any way to interact with php to determine which scripts are being run in any way? Yes Im praying for some magical technique..
My next question, is there any way to interact with php to determine which scripts are being run in any way? Yes Im praying for some magical technique..
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
I've noticed this problem too. Every once in a while, my complex parser scripts will hit a bug and go into infinite loops. I try a fix, refresh, and then try again. But since the default max execution time is 30 seconds, I easily go up to 8 processes, cumulatively using up all of my CPU (and necessating the manual killing of the processes)
I'd say use command line.
I'd say use command line.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
You'd probably need to use proc_open() and check with proc_get_status(). But as I recall when I did it a while back without those functions I got the process running and saved the PID in the session. The I could check if that PID was still running as necessary and report whether it was done or not. There was the usual monkeying around to get it to work as I recall.
(#10850)
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact: