1

If i have long running SQL query in my PHP script, is query execution time added to total script execution time?

For example, if my SQL query runs 25 seconds, and then i do something else for 6 seconds in a script then will "Maximum execution time 30 seconds" happen?

1 Answer 1

3

On Unix, no - waiting on external services (API calls, databases, etc) does not count towards the max execution time. On Windows, the time refers to the actual wall-clock time.

From the manual:

The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), stream operations, database queries, etc. is not included when determining the maximum time that the script has been running. This is not true on Windows where the measured time is real.

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.