Wordpress: “HTTP Error.” When Uploading Files

2020-02-01 04:14发布

I'm running WP 3.0.1 on a shared host using PHP5. I'm having issues uploading files that are a little larger via the media uploader in the admin section of WP.

Every time I try to upload a file thats over a few megabytes, it uploads, says its crunching, then gives me a big red "HTTP Error." - nothing more.

This only happens on files that are a little larger - ie a 20mb .mp3 file. A 5mb file seems to work fine. Whats weird is in the past we've uploaded 40mb files without a problem.

--

Here's the steps I've taken so far to try and remedy the situation:

  1. Double checked php.ini to ensure increase upload, post and memory size were high enough.
  2. Updated .htaccess to include filter the security mod I found elsewhere.
  3. Double checked all file permissions via ftp to ensure they were 755.
  4. Called the host - "They don't support 3rd party scripts" (I hate IPower)
  5. Tried with different audio files of similar size.
  6. Disabled all plugins

--

Do you guys have any more ideas regarding what might be causing the vague "HTTP Error." problem?

Thanks in advance.

12条回答
看我几分像从前
2楼-- · 2020-02-01 04:50

I tried all the commonly suggested php.ini changes as well as wp-config changes with no luck. Finally found someone suggesting to look at the XHR async-upload.php details in my browser and found out that our firewall was flagging the upload as a trojan (MalAgent.H_9218 to be specific) for some reason. So don't forget to check there, it could identify other possible upload issues as well.

Chrome instructions: Hit F12 and select the network tab, then attempt an upload with WordPress, make sure the filter row is on either All or XHR, in the left bottom pane find and select async-upload.php, in the right bottom pane select preview.

查看更多
ゆ 、 Hurt°
3楼-- · 2020-02-01 04:51

Our problem was that our load balancer ran out of hard disk space. Be sure to setup a log rotation that deletes the oldest logs after a period.

查看更多
beautiful°
4楼-- · 2020-02-01 04:54

server maybe have imagick installed as default library , for a fix for wordpress

I put the following code into my functions.php file. It works!

add_filter( 'wp_image_editors', 'change_graphic_lib' );

function change_graphic_lib($array) {
  return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
}
查看更多
男人必须洒脱
5楼-- · 2020-02-01 04:56

One of our clients, had the same issue.

Finally we found out that the wordpress "HTTP Error" when uploading images, was happening due to a change on the server side. The hosting comany, decided to add APC accelerate to the server in order to increase server's stability and speed. APC accelerate should work only with FastCGI and not with su, so they set PHP to run as FastCGI.

When using PHP as FastCGI, if you try to upload a file larger than 128KB, an error "mod_fcgid: HTTP request length 131388 (so far) exceeds MaxRequestLen (131072)" occurs and causes an 550 internal server error. This happens because the value of MaxRequestLen directive is set to 131072 bytes (128KB) by default. One way to correct this (if server uses Plesk), is to edit /etc/httpd/conf.d/fcgid.conf and set MaxRequestLen to a higher value, for example 15MB (MaxRequestLen 15728640). If server uses cPanel, this change can be done via the WHM of the server.

So, if you can upload images up to 128KB, this is the solution to your problem.

查看更多
疯言疯语
6楼-- · 2020-02-01 04:56

For me, "http error" issue occurred when php is running in fast cgi mode.

"MaxRequestLen" from mod_fcgid was limiting file upload size and wordpress was throwing "http error".

You need to add the following configurations in your httpd.conf (apache2.conf on ubuntu 14) :

<IfModule mod_fcgid.c>
  # 20MB
  MaxRequestLen 20000000
</IfModule>
查看更多
等我变得足够好
7楼-- · 2020-02-01 04:56

In my case solved by switching off Adblocker extention in browser

查看更多
登录 后发表回答