Bug #73041 [NEW]: max_execution_time starts counting when file upload starts
| From: | mitenem at outlook dot com | Date: | Wed, 07 Sep 2016 16:03:35 +0000 |
| Subject: | Bug #73041 [NEW]: max_execution_time starts counting when file upload starts | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-203855@lists.php.net to get a copy of this message | ||
From: mitenem at outlook dot com
Operating system: Windows
PHP version: 7.0.10
Package: *General Issues
Bug Type: Bug
Bug description:max_execution_time starts counting when file upload starts
Description:
------------
When I try to upload file and upload takes more than max_execution_time,
PHP returns fatal error maximum execution time was exceeded immediately
after file is uploaded. Error is always thrown on line in which first
<?php or <? appears.
I use Apache 2.4.23 with PHP 7.0.10 as an module (tested on systems with
both 32-bit and both 64-bit).
Apache configuration for PHP in httpd.conf:
LoadModule php7_module [...]/php/php7apache2_4.dll
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Various tested scenarios:
* max_execution_time = 30, max_input_time = -1
* uploaded 200 kB file: upload took about 5 seconds, no errors,
successfully uploaded
* uploaded 3 MB file: upload took about 35 seconds, fatal error
* uploaded 8 MB file: upload took about 90 seconds, fatal error
* max_execution_time = 30, max_input_time = 300
* uploaded 200 kB file: upload took about 5 seconds, no errors,
successfully uploaded
* uploaded 3 MB file: upload took about 35 seconds, fatal error
* uploaded 8 MB file: upload took about 90 seconds, fatal error
* max_execution_time = 300, max_input_time = 300
* uploaded 200 kB file: upload took about 5 seconds, no errors,
successfully uploaded
* uploaded 3 MB file: upload took about 35 seconds, no errors,
successfully uploaded
* uploaded 8 MB file: upload took about 90 seconds, no errors,
successfully uploaded
Script below was tested without php.ini file.
Values returned by ini_get:
max_execution_time = 30
max_input_time = -1
Test script:
---------------
<!DOCTYPE html>
<html>
<body>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post"
enctype="multipart/form-data">
<input type="file" name="file" />
<input type="submit" />
</form>
<?php print_r($_FILES); ?>
</body>
</html>
Expected result:
----------------
File should be normally uploaded and $_FILES should contain its data.
Actual result:
--------------
Fatal error: Maximum execution time of 30 seconds exceeded in
[...]\test.php on line 4
--
Edit bug report at https://bugs.php.net/bug.php?id=73041&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73041&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73041&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73041&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73041&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73041&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73041&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73041&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73041&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73041&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73041&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73041&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73041&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73041&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73041&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73041&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73041&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73041&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73041&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73041&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73041&r=mysqlcfg