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:59

For future readers, just managed to find the solution to this one after a tough day of searching.

There's a setting in the fcgid.conf file (for me in /etc/apache2/mods-enabled): FcgidMaxRequestLen. See https://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgidmaxrequestlen

I set that in bytes to an appropriate length and everything works. It seems that apache have changed their thinking on the default value (which is now 131072 bytes):

Before 2.3.6, this defaulted to 1GB. Most users of earlier versions should use this directive to set a more reasonable limit.

查看更多
The star\"
3楼-- · 2020-02-01 05:00

The problem, as you've already inferred, is in the size of your file upload. Just to remind you, HTTP isn't really built for transferring large files ... it can do it, but not always, and not very well. You're running into an issue where your host is cutting off the transfer because the file is too large. It's most likely a server setting somewhere that you don't have access to.

Since "they don't support 3rd party scripts" I'm guessing you're in a shared hosting environment, which is why something could change on your server without you doing anything. Possible solutions:

  1. Get a different host
  2. Use a dedicated server
  3. Transfer your larger files via FTP rather than from within WordPress.
查看更多
Explosion°爆炸
4楼-- · 2020-02-01 05:00

Put this line in your wp-config file:

define('WP_MEMORY_LIMIT', '64M');
查看更多
一纸荒年 Trace。
5楼-- · 2020-02-01 05:03

I had a similar problem with Nginx and PHP5-FPM (and WordPress 4.1).

Symptoms: the file (< 5MB, so relatively small) is partway through the transfer, as indicated by the progress bar, when suddenly you get the HTTP error message.

Even if you've set upload_max_filesize in your php.ini, you should also check post_max_size is (at least) as big. Remember to restart php5-fpm.

If it still doesn't work, edit your nginx.conf file (in Debian/Ubuntu it's /etc/nginx/nginx.conf) and add this in the http block:

client_max_body_size 100m;

Then restart Nginx.

查看更多
贼婆χ
6楼-- · 2020-02-01 05:04

I had the same issue whenever I tried to upload media, except I got the "HTTP Error" on files larger than 124Kb! WP 3.3.1, PHP 5.2.

I called my host and they upped memory to 64M (also changed this in wp-config) and upload_limit to 8 MB (default was 2 MB). This didn't work so I resorted to almost everything else, from tampering with the .htaccess to reinstalling WP to installing a fresh WP on another server, but everything pointed to a server issue. I called the host again and spoke to another technician who increased the allowed HTTP Request Length setting.

查看更多
▲ chillily
7楼-- · 2020-02-01 05:06

Our problem actually was client side: people tried to upload via drag and drop from OneDrive, files that have not been locally synchronised but showed up in the OneDrive folder. Resulted in "-200" error message. If file is on local harddrive, it worked fine.

查看更多
登录 后发表回答