1

Hi i'm trying to stop long running php scripts

so i've created this scrtipt for testing

<?php

ini_set('max_execution_time',1);
set_time_limit(1);

for($i=0;$i<2;$i++) {
        echo time();
        echo '    i:' . $i;
        echo '<br/>';
        sleep(2);
}
phpinfo();

the php info outputs

Directive           Local Value  Master Value
max_execution_time  1            30

but the script is not aborted after 1 sec. Why?

4

2 回答 2

1

Sleep Time doesn't count towards max_execution_time or in other words: Sleep Time doesn't count as execution time.

See: Does sleep time count for execution time limit?

于 2014-09-24T07:36:11.023 回答
0

This is a PHP Bug which should have been fixed in 5.3.1 . max_input_time overrides max_execution_time

于 2013-07-29T08:54:58.733 回答