[wp-trac] [WordPress Trac] #31372: media-new.php stops uploading after max_execution_time set in php.ini
WordPress Trac
noreply at wordpress.org
Wed Feb 18 19:59:14 UTC 2015
#31372: media-new.php stops uploading after max_execution_time set in php.ini
--------------------------+-----------------------------
Reporter: au.merci | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Upload | Version: 4.1
Severity: normal | Keywords:
Focuses: performance |
--------------------------+-----------------------------
== Environement ==
Windows Server 2008 (version 6, build 6002: SP2)
IIS Version 7.0.6000.16386
PHP Version 5.4.26
FastCGI
== Problem ==
When uploading a media file to Wordpress the upload only runs for the
max_execution_time set in php.ini. When that time has elapsed (for slow
connections or a large file) the multi-file uploader displays the generic
error "HTTP error." The browser uploader stops with the PHP error "max
execution time reached"
Is this behavior by design?
== Proposed solutions ==
1. '''set `set_time_limit(0)` in media-new.php, so a upload can take as
long as it needs''' [[br]] For IIS this solution is preferred, because
FastCGI automatically stops script execution when a connection is lost.
For Apache the additional code `ignore_user_abort(false);` might be needed
to prevent the script from executing after the client has aborted,
although that also is the standard behavior for Apache I think.
2. '''Display a more helpful error''' [[br]] "HTTP error." could
practially mean everything. It took me at least 2 hours to find out what
was causing the error. Displaying "Your upload exceeded the
max_execution_time set in PHP" makes things already a lot more
understandable.
== Thoughts about limits ==
File uploads are already limited by max_upload_size and max_post_size, so
it should make sense to not also limit them on how long they can take.
Some users simply don't have a fast enough connection to complete the file
upload in the max_execution_time specified by php.ini
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31372>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list