Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top