Find us on Facebook

LightBlog
Responsive Ads Here

Thứ Sáu, 23 tháng 2, 2018

How to Fix HTTP Error When Uploading Images?

Question:

I am using WordPress 3.4.1 on Ubuntu 12.04 using Apache and PHP 5.3.X
When I login to the dashboard and add a new post. Then try uploading an image to set as a featured image, I get a red box with a message "HTTP Error".
I have read about people saying to not use the flash uploader and just use the browser uploader, but when I try that, I just get a 500 Internal Server Error.
I have tried adding AddType x-mapp-php5 .php at the top of my .htaccess file, with no luck in change.
Disabling ALL plugins had no effect. I tried a fresh install. No luck.
Update 10/17/2016 - If you're using custom roles or capabilities, please try using a native role/capabilities and try again.
Things to consider checking:
  • File ownership
  • File permissions
  • .htaccess configuration
  • PHP Version 7+
  • WordPress Current Version
If you're operating behind a proxy, be sure you have your proxy server timeouts configured correctly.
WordPress 3.4.1 Media Upload HTTP Error

Answer:

After troubleshooting with @Wyck in chat, we have narrowed to the underlying issue.
The issue was related to my server configuration not having the proper amount of memory allocated to Apache/PHP.
If anyone has this same problem, please try verifying that you have enough (64MB+) server memory allocated to Apache/PHP in your server configuration settings. You can also add this to your wp-config.php file: define('WP_MEMORY_LIMIT', '64MB');
If the above solution does not work, read this article (Image/Media Uploader problems?) for further trouble shooting.
try adding one by one or all of the following .htaccess tweaks to the .htaccess file in the root directory of your WordPress installation.
Seriously, try one of each of the solutions below so you know which one did the trick. Don't just paste them all in your .htaccess file immediately.
Try this line:
AddType x-mapp-php5 .php
mod_security might be causing problems. Disable it to see if that is the problem. To do this, make an .htaccess file in your wp-admin directory. Add this to it:
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
If you're using Access Control based on Authentication on your Webserver (often known as htpasswd, Basic Authentiaction, password protected directory or similar), WordPress is not able to handle it for Flash Uploader, Cron and XMLRPC. Related files need to be excluded to work. Keep in mind that this might break your security considerations.
# Exclude the file upload and WP CRON scripts from authentication
<FilesMatch "(async-upload\.php|wp-cron\.php|xmlrpc\.php)$">
    Satisfy Any
    Order allow,deny
    Allow from all
    Deny from none
</FilesMatch>
One final note: some have said that if using a lesser version of PHP 5.3.X you can try disabling PHP Safe Mode.
If you are running WordPress multi-site and are receiving HTTP errors or Internal Server errors, related to image uploading, please read Uploading Images to Multi-Site Causes Failure to HTTP Error for other possible trouble shooting ideas and solutions.

Không có nhận xét nào:

Đăng nhận xét