php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2560 max_execution_time is not accurate
Submitted: 1999-10-18 11:48 UTC Modified: 2002-03-21 12:19 UTC
From: djm at web dot us dot uu dot net Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0 Beta 2 OS: BSDI BSD/OS 4.0.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: djm at web dot us dot uu dot net
New email:
PHP Version: OS:

 

 [1999-10-18 11:48 UTC] djm at web dot us dot uu dot net
I'm using PHP 4.0B2 as a DSO with apache 1.3.9.  In my httpd.conf I have set

AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php
php_admin_flag safe_mode On
php_admin_value doc_root "/homes/www141/webtest"
php_admin_value open_basedir "/homes/www141/webtest"
php_admin_value safe_mode_exec_dir "/homes/www141/webtest/bin"
php_flag log_errors On
php_value error_log "/homes/www141/webtest/logs/php.log"
php_value max_execution_time 3
php_value memory_limit 8388608

When I run the following PHP script, it is not aborted before printing the
second message, despite having run for more than 3 seconds.  And it
takes about 13-18 wall clock seconds before PHP aborts the infinite loop.  Printing
phpinfo() confirms that max_execution_time is indeed set to 3.

<html><head><title>test of max_execution_time</title></head><body>
<? 
echo "before<p>\n"; sleep(10); echo "after<p>\n";
while (1) { $i++; }
 ?>
</body></html>

This is being run on a 450MHz server that's doing nothing else, so I don't
think CPU contention is an issue.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-12-03 12:27 UTC] andrei at cvs dot php dot net
Fixed in CVS by Rasmus.
 [2002-03-21 12:16 UTC] php dot net at chiefworks dot com
This bug is still present in PHP 4.1.2, exactly as described by djm
 [2002-03-21 12:19 UTC] rasmus@php.net
I doubt that - remember this is cpu time, not wall clock time.  sleep(10) doesn't count.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 03:01:29 2024 UTC