By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,051 Members | 1,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,051 IT Pros & Developers. It's quick & easy.

Code that never exits?

P: n/a
I'm getting incoming emails to activate a PHP script, not web page
requests - so I can't visibly see things with a browser.

Is there any way I can detect if one of my PHP scripts never exits - either
the script "crashes" or enters an infinite loop?

Is there some sort of timeout value a server will place on a script, that it
must complete execution by a certain time, or it gets stopped?

And are there any questions I should be asking of my web hosting service
i.e. "does your server know if a script has gone bad or has run for too
long?"

Thanks in advance,

Simon.


Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I found my answer:

There is a default script execution time set to 30 seconds by php, at which
point the script will stop processing and it will spit out an error.

For more info check out the docs on the php function:

set_time_limit
"simonc" <no@email.com> wrote in message
news:CV********************@news2.news.adelphia.ne t...
I'm getting incoming emails to activate a PHP script, not web page
requests - so I can't visibly see things with a browser.

Is there any way I can detect if one of my PHP scripts never exits - either the script "crashes" or enters an infinite loop?

Is there some sort of timeout value a server will place on a script, that it must complete execution by a certain time, or it gets stopped?

And are there any questions I should be asking of my web hosting service
i.e. "does your server know if a script has gone bad or has run for too
long?"

Thanks in advance,

Simon.


Jul 17 '05 #2

P: n/a

"simonc" <no@email.com> wrote in message
news:QW********************@news2.news.adelphia.ne t...
I found my answer:

There is a default script execution time set to 30 seconds by php, at which point the script will stop processing and it will spit out an error.

For more info check out the docs on the php function:

set_time_limit


Simon,

set_error_handler() might help you too - if your scripts were timeing out,
or abort for some reason or other, you can 'trap' the failure with your own
custom made function (thus have it report elsewhere or write something to a
log file or dump variables to a file helping you to debug things). Check
the online PHP Manual under "Error Handling and Logging Functions"... there
might be more tools to help you out there...

randelld
Jul 17 '05 #3

P: n/a
"simonc" <no@email.com> wrote in message news:<CV********************@news2.news.adelphia.n et>...
I'm getting incoming emails to activate a PHP script, not web page
requests - so I can't visibly see things with a browser.

Is there any way I can detect if one of my PHP scripts never exits - either
the script "crashes" or enters an infinite loop?

Is there some sort of timeout value a server will place on a script, that it
must complete execution by a certain time, or it gets stopped?

And are there any questions I should be asking of my web hosting service
i.e. "does your server know if a script has gone bad or has run for too
long?"


Another thing you can do is just make the script write to a logfile
when the script is called and when the script is ready, and if there
are any entries without the second log message then you know that the
script didn't complete.
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.