Infite loops and other unintended coding events

Infite loops and other unintended coding events

Postby Cricket » Tue Jul 18, 2006 8:38 am

Very new to PHP.

If (when?) I create an infinite loop, memory leak, or any of the other things which are likely to confuse the system:

- what's going to happen
- is there anything I can/should do besides wait for a reset?

(The tutorial says I should click on the Apache icon in on the right of my task bar to restart the server. Somehow I don't think you'd like me to do that. Still, it's better than the tutorials that don't even mention the possibility.)

Assuming the answer is wait for the server to notice the problem and reset things, how long will that take? Is there a way for me to reconfigure it safely (so I'm not waiting for hours)? (I've checked phpinfo and don't understand half the settings, so it might be hiding in plain sight.)

Thanks in advance,

Sandy
cricket@onebit.ca
Cricket
 
Posts: 10
Joined: Fri Nov 25, 2005 7:29 am

Postby shivin » Mon Oct 02, 2006 1:29 am

If the process is on an infinite loop, you have to kill the process ID via SSH.
shivin
 

Postby Cricket » Wed Oct 04, 2006 10:16 am

Seeing as I've no clue how to kill a process, I guess this isn't a good idea.

Wouldn't the php timeout do something?

Cricket
Cricket
 
Posts: 10
Joined: Fri Nov 25, 2005 7:29 am

Postby shivin » Mon Oct 09, 2006 1:20 am

Yes. That is an alternative though. By default, php scripts will timeout after 30 seconds.
If you have ssh access you can kill the pricess without waiting for the time-out to happen.

just enter this command

kill -9 pid
where pid specifies the process ID
shivin
 


Return to PHP

Who is online

Users browsing this forum: No registered users and 0 guests

cron