alioygur
alioygur

Reputation: 5464

php max_execution_time value is 30seconds but run 200seconds?

im getting php maximum execution time like this.

<?php ini_get('max_execution_time'); ?>
output: 30

but i can run this script.

<?php 
sleep(200);
echo "no timeout error";
?>
output: no timeout error

im how to get real ini value ?

best regards

Upvotes: 0

Views: 1024

Answers (2)

troelskn
troelskn

Reputation: 117477

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.

Since sleep is a system call, it doesn't count against the max execution time.

Upvotes: 3

genesis
genesis

Reputation: 50976

Your max_exec_time IS 30 seconds, but it's not timeouting because time is not running in sleep() but only when script is doing something

Upvotes: 0

Related Questions