php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37408 max_execution_time seems to be in affect for interactive CLI sessions
Submitted: 2006-05-11 15:28 UTC Modified: 2006-05-27 11:27 UTC
Votes:11
Avg. Score:4.9 ± 0.3
Reproduced:11 of 11 (100.0%)
Same Version:9 (81.8%)
Same OS:5 (45.5%)
From: Jared dot Williams1 at ntlworld dot com Assigned: helly (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.1.4 OS: Win2000
Private report: No CVE-ID: None
 [2006-05-11 15:28 UTC] Jared dot Williams1 at ntlworld dot com
Description:
------------
max_execution_time seems to be in affect for interactive CLI sessions

5.1.4 & 5.2 both exhibit the problem.

Reproduce code:
---------------
E:\php-5.1.4-Win32>php -a
Interactive mode enabled

<?php

Fatal error: Maximum execution time of 60 seconds exceeded in E:\php-5.1.4-Win32\- on line 3

Expected result:
----------------
max_execution_time to be disabled/infinite.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-12 02:05 UTC] mlee at kanhan dot com
The bug does not just affect interactive sessions but normal CLI operations as well.  Try put the following code in a file:

<?php

for($i = 0; ; ++$i) {
	echo $i."\n";
	sleep(1);
}

?>

Then run it at the command prompt:

c:\>php loop.php

After running for about 60 seconds, the following error occurs:

Fatal error: Maximum execution time of 60 seconds exceeded in C:\temp\loop.php on line 6
 [2006-05-12 02:08 UTC] mlee at kanhan dot com
Sorry the command in my previous comment should be this:
 
C:\temp>php loop.php
 [2006-05-16 00:11 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

To chang execution time limit either use set_time_limit() 
function or run CLI php with -d max_execution_time=0 flag
 [2006-05-16 00:25 UTC] Jared dot Williams1 at ntlworld dot com
F:\Temp\CVSProjects\ezcomponents\trunk>php -d max_execution_time=0 -a
Interactive mode enabled

<?php
sleep(4);
echo $a;'

Fatal error: Maximum execution time of 30 seconds exceeded in F:\Temp\CVSProjects\ezcomponents\trunk\- on line 3
 [2006-05-16 19:58 UTC] mlee at kanhan dot com
It IS a bug.  I've double-checked the documentation:

http://www.php.net/manual/en/features.commandline.php

It says the default value of max_execution_time is 0 for the CLI version.
 [2006-05-17 14:06 UTC] mike@php.net
What's defined for max_execution_time in your php.ini
 [2006-05-18 13:42 UTC] mlee at kanhan dot com
It's 30 seconds in my php.ini, but the error I get is this:

"Fatal error: Maximum execution time of 60 seconds exceeded"

Anyway, I thought the documentation is quite clear about the fact max_execution_time is one of the overridden php.ini directives for the CLI executable and that the default value is 0 (infinite).
 [2006-05-19 08:05 UTC] psadac at gmail dot com
it's a bug. I run php 5.1.4 over Windows XP, i have max_execution_time = 240 in my php.ini, set_time_limit(0) in my php script and i get "Maximum execution time of 60 seconds exceeded".
 [2006-05-25 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-05-27 01:02 UTC] helly@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-05-27 11:27 UTC] Jared dot Williams1 at ntlworld dot com
Latest snaps do seem fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 14:01:29 2024 UTC