Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I shut off an infinite php script ?

Status
Not open for further replies.

dcnguyen

Technical User
Mar 22, 2005
54
US
I'm ran a PHP script on my hosted server that updates some values in a mysql table. After I ran it, I noticed, oops, it will run forever, and it's not a particularly intensive one either (I put in a usleep to slow it down). I'm pretty sure the script is still going, because even after I delete the table, and then reinstall it, that table will have the updated values. When I run a Mysql command to update those fields to an arbitrary value, like zero, and then check the table again, the fields will have the updated values. How do I shut this off?
 
to clarify: the script ran a simple while loop without end. It was just a php script that ran a mysql command, something like UPDATE table SET field="3"...so when I manually set the field to NULL, and then refreshed the table, the field would be 3. If I deleted the table and recreated it, field would be equal to 3 again. I started the script with my browser. shutting off the browser apparently doesn't work, and when I check running processes by sshing into my webhost, nothing shows up.

When I renamed the table, the values in field stopped being updated.
 
the script should have a max execution time as set by your php.ini file. unless you have overridden this with a set_time_limit(0) or similar.

shutting off a browser would not stop a server process.

whether or not you see the process running would, i guess, be a question of:

1. how you have configured php (sapi or cgi)
2. whether you have the correct privileges to view the server processes.

stop the webserver, stop php and restart them.

if that doesn't work, reboot.

the max_execution_time directive is there to protect you from this kind of error. bypass it at your peril!
 
You can restart IIS and that will kill any scripts running on your webserver.

[monkey][snake] <.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top