0

I want to run a .php file via terminal (I have CentOS), so I want to know is there any limitation in execution time when I run the .php files with terminal, and not Apache?

2
  • how long is it taking before it timeouts? 30 seconds? Commented Nov 5, 2012 at 17:20
  • @Landon I didn't run the script before, but max_execution_time is 30. Commented Nov 5, 2012 at 17:28

3 Answers 3

4

Time limit should be the same. See max_execution_time in your php.ini. You can force it with set_time_limit(90) in your php code for example.

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

8 Comments

Doesn't Apache also enforce its own limit too?
So, I couldn't find time_limit in my php.ini, but max_execution_time is 30.
Yes, that's it. Change it or force with set_time_limit(n)
@jadkik94 that's other thing.. That's Apache's timeout value.. It usually does not make problems.
Just a silly thing! Now, it's about 12 minutes that I've run the script with sudo php -f index.php and it's working now! Is this a unusual behavior?
|
2

You can set that value to 0:

set_time_limit(0)

This will prevent timeouts entirely. Be careful though. The time outs are in there for a purpose.

Comments

1

You can use set_time_limit(n) in your script http://php.net/manual/en/function.set-time-limit.php

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.