php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20097 set_time_limit doesn't work on large file uploads
Submitted: 2002-10-25 14:32 UTC Modified: 2002-10-25 14:35 UTC
From: php at subtitled dot com Assigned:
Status: Closed Package: PHP options/info functions
PHP Version: 4.2.3 OS: Windows 2000 SP3
Private report: No CVE-ID: None
 [2002-10-25 14:32 UTC] php at subtitled dot com
Test code (test.php) running under Windows 2000 with PHP running as a CGI binary under IIS (not in safe mode) as obtained and installed under the "Downloads" section of the PHP website (the zip package, not the installer version):

<?php
set_time_limit(0);
ignore_user_abort(true);
phpinfo();
?>

Running the script directly from your browser displays the phpinfo() page with a local max_execution_time set to 0 (with a global value of 30).

Now create an HTML form page that accepts a large file for upload (modifying php.ini's post_max_size and upload_max_filesize as necessary) and which submits to this script.  If the file is large enough so that the time it takes to upload to the server is > max_execution_time, PHP returns the following error to the client:

Fatal error: Maximum execution time of 30 seconds exceeded in D:\InetPub\test.php on line 2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-25 14:35 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

In the CVS there is a new option (max_input_time) allowing you to set the timeout value for parsing of input data such as file uploads.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 08:01:29 2024 UTC