0

I set max_execution_time for my php engine (below you can see phpinfo() output on my host) but it seems not working for my following code:

phinfo() :

                     Local value     Master value
                    -------------    ------------    
max_execution_time       5                 5

My PHP code :

<?php 
$start=time();
$x=0;
while($x<10) {
   $x++;
   echo time() - $start;
   echo '<br/>';

}

Code Output:

0
0
0
0
0
0
0
0
0
......


It should endup when after 5 seconds of execution( due to max_execution_time) but it doesn't time out even after 20 seconds,then I stop it manually. How would i solve this problem?( my max_time_execution setting is not working

Seyfi
  • 1,832
  • 1
  • 20
  • 35
  • in short, sleep is not counted, only actual running execution time is. –  Jun 21 '16 at 22:17
  • I noted that when i remove `sleep`, it doesn' change and code does not terminate on timeout! so `sleep` is not problem. – Seyfi Jun 22 '16 at 07:59

0 Answers0