Canadian Webhosting Forums Forum Index Canadian Webhosting Forums
Discussion Forums
 
 FAQFAQ   SearchSearch      RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Infite loops and other unintended coding events

 
Post new topic   Reply to topic    Canadian Webhosting Forums Forum Index -> PHP
Author Message
Cricket



Joined: 25 Nov 2005
Posts: 6

PostPosted: Tue Jul 18, 2006 7:38 am    Post subject: Infite loops and other unintended coding events Reply with quote

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
Back to top
shivin
Guest





PostPosted: Mon Oct 02, 2006 12:29 am    Post subject: Reply with quote

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



Joined: 25 Nov 2005
Posts: 6

PostPosted: Wed Oct 04, 2006 9:16 am    Post subject: Reply with quote

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
Back to top
shivin
Guest





PostPosted: Mon Oct 09, 2006 12:20 am    Post subject: Reply with quote

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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Canadian Webhosting Forums Forum Index -> PHP All times are GMT - 8 Hours
Page 1 of 1

 


Hosting Plans :: Flash Tutorials :: Contact Us :: Privacy Policy


Powered by phpBB, MySQL and PHP