Make WordPress Core

Opened 6 years ago

Last modified 6 years ago

#43310 new defect (bug)

Generic "HTTP Error" when uploading PDFs via Media area

Reported by: bearlydoug's profile BearlyDoug Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.4
Component: Media Keywords: needs-patch
Focuses: administration, multisite Cc:


This might be tied in with Ticket #41973. This may also be tied into this issue, which was previously fixed for 4.7x.

Currently using the following code to handle image processing:

	// Fix image processing
	add_filter( 'wp_image_editors', 'change_graphic_lib' );
	function change_graphic_lib($array) {
		return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );

I've done all the digging around I can. File upload max size is 140 megs (the test PDF I used is only 13 megs). I've done the .htaccess and php.ini tweaks needed to allow plenty of upload time. Images no longer return the arbitrary "HTTP Error" after adding the above function.

PHP 7.0.27-0+deb9u1 (cli) - This is the latest stable release, per Debian.

This is what I passed along to our customer:

"You’ll have to “tough your way” into the PDF uploads… after you upload a PDF, give it a few minutes… then do a power refresh on the media gallery (I would recommend you upload it through the media gallery first, rather than using the “Add Media” feature on posts and pages)."

Change History (12)

#1 @netweb
6 years ago

  • Focuses coding-standards removed

#2 in reply to: ↑ description @SergeyBiryukov
6 years ago

Replying to BearlyDoug:

File upload max size is 140 megs (the test PDF I used is only 13 megs).

What about post_max_size?

#3 @BearlyDoug
6 years ago

Apologies for not including that earlier. The max input time is actually pretty decent; I've got my own WP sites with a lower max input time and I tend to upload around 30 megs of photos at a single clip, without issue, so I know it's not the max input time threshold being hit.

memory_limit = 200M
file_uploads = 1
upload_max_filesize = 140M
max_input_time = 60
post_max_size = 140M

Let me also note that I'm a WP Dev and Systems (server) Administrator for a Tech firm, managing 100+ servers and 150+ WP sites. Most of our systems are Debian based NginX + Apache2 systems, separate MySQL servers. The team is pretty skilled and can track down a lot of issues... we already know that there's issues with plugins not being fully PHP7 compliant (I actually have a separate bug report for a plugin that is having issues, with that plugin developer, right now).

What other information can I provide? I'd love to be able to track this issue down, once and for all, so we can start migrating to more PHP7 boxes. :)

Last edited 6 years ago by BearlyDoug (previous) (diff)

#4 @andrewteg
6 years ago

I'll add we're having the same issue. We are able to disable ImageMagick on this server which solves the issue until we need ImageMagick. We installed using files linked on (last row which matches our server setup)


Windows Server 2012 R2 Standard Edition
Compiler 	MSVC14 (Visual C++ 2015)
Architecture 	x64 
Thread Safety 	disabled

PHP Version 7.1.2

memory_limit = 256M
file_uploads = On
upload_max_filesize = 32M
max_input_time = 60
post_max_size = 64M

Apache Error Log

[fcgid:warn] (OS 109)The pipe has been ended.  : [client *****:60080] mod_fcgid: get overlap result error, referer: http://*****/wp-admin/upload.php
[core:error] [pid 7476:tid 5116] [client *****:60080] End of script output before headers: async-upload.php, referer: http://*****/wp-admin/upload.php

#5 @johnbillion
6 years ago

  • Component changed from Media to Upload
  • Focuses ui performance removed
  • Keywords reporter-feedback added
  • Summary changed from Arbitrary "HTTP Error" when uploading PDFs via Media area to Generic "HTTP Error" when uploading PDFs via Media area

Which image processing libraries are present in the server? GD? Imagick?

Can you install the Debug Media plugin and see if it says anything interesting?

#6 @BearlyDoug
6 years ago

@johnbillion, apologies for the delay.

Media Debugging Info
Active Editor WP_Image_Editor_GD
Imagick Module Number 1687
ImageMagick Version ImageMagick 6.9.7-4 Q16 i686 20170114
GD Version 2.2.4
Ghostscript Version 9.20
Memory Limit 300M
Max Execution Time 90
Max Input Time 20
Upload Max Filesize 80M
Post Max Size 80M

#7 @BearlyDoug
6 years ago

FYI, tomorrow morning, I will have a barebones WP installation running on one of our PHP7 boxes. I'll be happy to set up an account for you, @johnbillion, and get you FTP access, as well. Found you on Twitter and gave you a follow there... that way I can get you access details directly, as needed. :)

#8 @BearlyDoug
6 years ago

  • Keywords reporter-feedback removed

Adding some additional observations: This apparently centers around the thumbnail creation (GD module)... or lack there of.

Ironically, I found this thread (for a plugin) that may shed some light on this issue:

I do have the test environment set up for additional testing, so if one of the devs (@johnbillion, perhaps?) needs access, see my comment above. :)

#9 @BearlyDoug
6 years ago

  • Keywords dev-feedback added

I hate to re-bump this, but two weeks without any response is not good. I have a bare-bones WP instance installed on a PHP7 development box, ready for a dev to access, when requested. :)

#10 @SergeyBiryukov
6 years ago

#44787 was marked as a duplicate.

#11 @BearlyDoug
6 years ago

  • Component changed from Upload to Media

The ticket @sergeybiryukov closed as a duplicate has updated and CORRECTED information. This ticket mis-identified the source/cause.

Let's see if we can get traction back on this ticket again, please.

#12 @johnbillion
6 years ago

  • Keywords needs-patch added; dev-feedback removed

Is there a way of exposing errors from the GD / Imagick extensions (or lack thereof) and passing them through to the upload handler so they can be exposed to the user?

A technical error is never a good thing to expose, but it certainly beats "HTTP Error".

Note: See TracTickets for help on using tickets.