Page 1 of 1

Infite loops and other unintended coding events

PostPosted: Tue Jul 18, 2006 8:38 am
by Cricket
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

PostPosted: Mon Oct 02, 2006 1:29 am
by shivin
If the process is on an infinite loop, you have to kill the process ID via SSH.

PostPosted: Wed Oct 04, 2006 10:16 am
by Cricket
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

PostPosted: Mon Oct 09, 2006 1:20 am
by shivin
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