php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16880 max_execution_time affects large uploads
Submitted: 2002-04-27 15:40 UTC Modified: 2002-11-07 12:05 UTC
Votes:12
Avg. Score:4.9 ± 0.3
Reproduced:11 of 11 (100.0%)
Same Version:9 (81.8%)
Same OS:6 (54.5%)
From: zebz at hotmail dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.3.0-dev OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
44 + 43 = ?
Subscribe to this entry?

 
 [2002-04-27 15:40 UTC] zebz at hotmail dot com
I recently upgraded PHP 4.1.2 to PHP 4.2 on my local Windows computer and it works a lot better for large uploads (no more huge RAM usage, etc).

However I noticed that on this new version the max_execution_time setting counts the upload time, which doesn't make sense since the PHP script is called only after the file has been uploaded on the temp directory. set_time_limit() doesn't solve the problem since the time expires right before the script is called.

For example if I set max_execution_time to 10 seconds and upload a 50Mb file, the file will take 20-30 seconds to be uploaded (remember, this is a local upload) and at the end I'll get a "Maximum execution time of 10 seconds exceeded" error. 

This would force anyone who wish to upload large files on a remote server to set the max_execution_time setting to 10 *minutes* or more, which, again, does not make sense.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-30 14:05 UTC] zebz at hotmail dot com
Will this bug be fixed on PHP 4.2.1? It makes huge uploads impossible without basically making the max_execution_time setting useless and I'm sure most hosts will refuse to set this setting to 10 minutes :(

Someone reported having the same problem under Windows 2000
 [2002-06-16 00:09 UTC] sniper@php.net
Which webserver? Apache 1.3.xx?

 [2002-06-16 00:25 UTC] zebz at hotmail dot com
Yes, Apache 1.3.xx
 [2002-07-19 12:23 UTC] hjm at holos dot pt
I have the same problem running Php 4.2.1 on Apache on a win NT server machine
 [2002-10-04 08:20 UTC] pfasser at shena dot it
I have the same problem running Php 4.2 on IIS on a W2K server machine
 [2002-10-12 10:24 UTC] sniper@php.net
This should be fixed..

 [2002-10-12 14:01 UTC] pbaum at wi dot rr dot com
I have the same problem with iplanet web and IIS in win 2k.
 [2002-10-12 21:02 UTC] webmaster at tsn dot dk
Confirmed in 4.2.3
 [2002-10-12 21:59 UTC] sniper@php.net
Please try using this CVS snapshot:

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

(I can not reproduce this with this snapshot) 

 [2002-10-12 22:04 UTC] sniper@php.net
Nevermind, I had wrong php.ini settings.
Reproduced here too..

 [2002-10-21 08:12 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.

There is a new ini setting, max_input_time that will allow you to specify how much time a script may spend parsing input data such as file uploads etc...
 [2002-11-07 10:51 UTC] zebz at hotmail dot com
Why did you have to introduce this new max_input_time setting? Sorry but the default value of max_input_time is ridiculously low, 60 seconds is just enough to upload a 300Kb file with a dialup connection!

I can't find any documentation yet but I bet that this max_input_time setting can only be changed on a system-wide level. Is the goal to produce an easy-to-use language? Do you realize that the large majority of PHP users on virtual hosting can't change their configurations and having such ridiculous default settings makes uploads impossible for all of them?
 [2002-11-07 12:05 UTC] iliaa@php.net
This option is PHP_INI_ALL, meaning that you can change it's value anywhere you want. IMHO your complaints have no merit.
 [2002-11-08 04:42 UTC] m dot ford at lmu dot ac dot uk
Um -- shouldn't it be PHP_INI_SYSTEM | PHP_INI_PERDIR only, since setting it within a script can't possibly influence file uploads which must necessarily already have happened?

Cheers!

Mike
 [2003-04-19 18:22 UTC] elfugitivo at lycos dot com
Well i?m working with php 4.3.1 and the problem is still there, wich is the correct use of ini_set for max_execution_time?

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 20:01:29 2024 UTC