Wordpress: “HTTP Error.” When Uploading Files

前端 未结 12 1766
既然无缘
既然无缘 2020-12-06 06:10

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.

Eve

相关标签:
12条回答
  • 2020-12-06 06:45

    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>
    
    0 讨论(0)
  • 2020-12-06 06:49

    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' );
    }
    
    0 讨论(0)
  • 2020-12-06 06:52

    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.

    0 讨论(0)
  • 2020-12-06 06:53

    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.

    0 讨论(0)
  • 2020-12-06 06:54

    Put this line in your wp-config file:

    define('WP_MEMORY_LIMIT', '64M');
    
    0 讨论(0)
  • 2020-12-06 06:54

    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.

    0 讨论(0)
提交回复
热议问题