0

I have a PHP CLI script that continually times out, and I can't figure out the source of the timeout. Seemingly "randomly" the script will stop (with no PHP error in the logs) and give the following output to console:

timeout, elapsed_time = 60

I'm setting PHP's time limit via set_time_limit(0); intermittently but it doesn't seem to be making a difference.

Besides that, PHP is supposed to throw an error if it hits its timeout, and no error is thrown, so could this timeout be triggered by something other than PHP?

The script is started by a bash script ".sh" on a Ubuntu machine.

Thanks!

4
  • 5
    PHP CLI should have no timeout by default, meaning you shouldn't have to explicitly call set_time_limit(0); - My hunch would be that it's something other than PHP itself (PHP does not generate an error that looks like the one you have posted, when the execution time limit is hit) - It's still possible that a component of your script is generating this output though. Commented Sep 26, 2012 at 13:40
  • 1
    Take a look into the script first, what is generating that output? Also how are you invoking the script? Maybe it's a systems hard limit? What is the return code of the script? Commented Sep 26, 2012 at 13:43
  • 1
    Maybe something is killing the bash script and its children? Commented Sep 26, 2012 at 13:44
  • The bash script sets DISPLAY and kills a couple processes that could interfere with the script, then starts the script with "/usr/bin/php <path and script name>.php". It then waits for the PHP script to finish, and performs a bit of cleanup. Could the issue be in the bash script? I agree that it doesn't really seem like a PHP timeout. Commented Sep 26, 2012 at 13:53

1 Answer 1

1

Thanks to everyone who helped me out.

I tried running the script through nohup and the timeout issue seems to have disappeared. Hope this helps someone else!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.