php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37306 max_execution_time = max_input_time
Submitted: 2006-05-04 12:42 UTC Modified: 2006-05-11 22:12 UTC
Votes:5
Avg. Score:5.0 ± 0.0
Reproduced:5 of 5 (100.0%)
Same Version:3 (60.0%)
Same OS:3 (60.0%)
From: php at placebo dot demon dot nl Assigned: dmitry
Status: Closed Package: PHP options/info functions
PHP Version: 5CVS-2006-05-04 (snap) OS: *
Private report: No CVE-ID:
 [2006-05-04 12:42 UTC] php at placebo dot demon dot nl
Description:
------------
PHP 5.1.3 and up uses the max_input_time php.ini setting for the maximum execution time of a script. It should you the max_execution_time setting.

correct 5.1.2
wrong 5.1.3
wrong 5.1.5-dev Built On: May 04, 2006 06:30 GMT

Reproduce code:
---------------
php.ini setting:
max_execution_time = 1
max_input_time = 5

code:
$time_end = time() + 10;
while (time() <= $time_end) {
}

Expected result:
----------------
Fatal error: Maximum execution time of 1 seconds exceeded in c:\Apache\htdocs\site\test.php on line 23

Actual result:
--------------
Fatal error: Maximum execution time of 5 seconds exceeded in c:\Apache\htdocs\site\test.php on line 23

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-04 13:32 UTC] n dot escuder at intra-links dot com
The same problems can be reproduced on linux platform with php 5.1.3 CLI and this break all scripts who work with the CLI version that have a main loop.
 [2006-05-04 19:37 UTC] subscription at nazarenko dot net
I have a similar problem too.
However, what I've found is not *exactly* the case described here.

I have many CLI scripts which I use with the PHP-CLI (Linux).
Most of them work fine, however one script that does the indexing of lots of documents fails after a few *minutes* with the error message:

"Maximum execution time of 30 seconds exceeded."

My php-cli.ini settings are as follows:

max_execution_time => 0 => 60
max_input_time => 30 => 30

Since only one of my scripts fails with that message afer running for *MORE* than 30 or 60 seconds and other scripts (PHP-CLI based daemons) run fine 24/7, I can see three issues here:

1) It is very likely to do with the *max input time*, not max execution time.

2) The error message is wrong. I believe it should be "Maximum input time of 30 seconds exceeded"

3) Even if input time is more than the limit, it should not break a script run under PHP-CLI.
 [2006-05-04 20:04 UTC] subscription at nazarenko dot net
OK. After additional testing I must take back some of my comments above. It looks like the original poster was correct :)

1) max_input_time value becomes max_execution_time
2) CLI SAPI which normally should ignore max_execution_time breaks scripts with the error messages about execution time.

NOTE: setting max_input_time and max_execution_time to "0" in php-cli.ini fixes the problem but I still believe this is a bug which must be fixed ASAP.
 [2006-05-11 22:12 UTC] dmitry@php.net
Fixed in CVS HEAD, PHP_5_2 and PHP_5_1.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 17 16:02:22 2014 UTC