Bug #71744 [Com]: max execution time doesn't take effect in php built-in server
| From: | berarma at hotmail dot com | Date: | Mon, 14 Nov 2016 11:43:18 +0000 |
| Subject: | Bug #71744 [Com]: max execution time doesn't take effect in php built-in server | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-205353@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71744&edit=1
ID: 71744
Comment by: berarma at hotmail dot com
Reported by: memoword at 163 dot com
Summary: max execution time doesn't take effect in php
built-in server
Status: Not a bug
Type: Bug
Package: Built-in web server
Operating System: Windows 7 sp1
PHP Version: 5.6.19
Block user comment: N
Private report: N
New Comment:
It does work but not like I would expect. And it doesn't seem well documented either.
Using PHP 5.6.27 in Debian Jessie. Although the built-in server uses the cli configuration it
doesn't hardcode max_execution_time to 0.
When
max_execution_time: 30
max_input_time: 60
-> Fatal error: Maximum execution time of 60 seconds exceeded
When
max_execution_time: 30
max_input_time: -1
-> Fatal error: Maximum execution time of 30 seconds exceeded
When
max_execution_time: 0
max_input_time: -1
-> OK
Previous Comments:
------------------------------------------------------------------------
[2016-03-11 10:19:43] memoword at 163 dot com
I realized that max_execution_time is 30 by default and I unexpectly found that when I change the
max_input_time to -1, the time limitation disappeared. And it was set to 60 before I change it. That
may means the execution time in built-in server is controlled by max_input_time...
------------------------------------------------------------------------
[2016-03-10 08:25:26] ab@php.net
Thanks for the report. I currently don't reproduce this behavior. From your description it is
most likely a configuration issue. Default for max_execution_time is 30 seconds, but you tell it
stops after 60 seconds. Most likely you load a wrong php.ini.
Thanks.
------------------------------------------------------------------------
[2016-03-08 13:47:42] memoword at 163 dot com
Description:
------------
The max_execution_time option in php.ini doesn't work in php built-in web server
The environment is windows 7 sp1 x64 ultimate with php-5.6.19-nts-Win32-VC11-x86
I use a new php.ini-development as my php.ini file and set max_execution_time to zero. Then make the
scripts below as index.php.
Run the server: php -S localhost:8000 index.php
Then visit localhost:8000
After 60s it doesn't work anymore, and shows 'Fatal error: Maximum execution time of 60
seconds exceeded in D:\********\index.php on line 4'
Test script:
---------------
<?php
while(1) {
echo date('H:i:s').'<br />';
sleep(5);ob_flush();flush();}
Expected result:
----------------
As I set max-execution-time to zero, the script should run forever.However it only works for 60s.
When I set max-execution-time to 600, it still only works for 60s.
After 60s it doesn't work anymore, and shows 'Fatal error: Maximum execution time of 60
seconds exceeded in D:\********\index.php on line 4'
Actual result:
--------------
It stops after 60s.
When I run the server with php -S localhost:8000
and visit localhost:8000
It doesn't stop anymore even my max-execution-time is only 5
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71744&edit=1