0

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

4

2 回答 2

3

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.

于 2011-09-03T23:33:57.447 回答
0

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

于 2011-09-03T23:33:34.533 回答