“HTTP Error” is one of the WordPress’s most common and frustrating error. It’s kinda overwhelming when you suddenly get “HTTP Error” without any clue left behind to fix it. Though there can be different possible reasons to this particular problem, we will try to solve this problem with all of the different possible ways.
Different Possible Ways to Fix HTTP Error in WordPress:
Try implementing different methods incrementally to see if it fixes this problem.
Method 1:
define('WP_MEMORY_LIMIT', '64M')
into your wp-config.php file.
- To learn more about increasing memory limit in PHP read this official documentation at WordPress Codex.
Method 2:
Add this piece of code at the top of your .htaccess file:
SetEnv MAGICK_THREAD_LIMIT 1
Note (If you have Wordfence plugin installed):
- It’s usually seen after installing Wordfence plugin.
- If it doesn’t work try changing Wordfence Plugin’s Firewall status from “Enabled and Protecting” to others or try unchecking some of the options like “file_upload”
- After changing configurations or disabling plugins clear Cache or switch themes to another one temporarily to clear caches.
Method 3:
Add one of these codes in .htaccess (at the top):
<IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule>
or
# 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>
or
AddType x-mapp-php5 .php
(at the very top of your .htaccess file)
Method 4:
It may also happens due to EWWW Image optimizer plugin. Try after disabling this plugin.
- After changing configurations or diabling plugins clear Cache or switch themes to another temporarily to clear the cache.
Method 5:
Disable Wordfence plugin or change Firewall status from “Enabled and Protecting” to others or try unchecking some of the options like “file_upload”
- After changing configurations or diabling plugins clear Cache or switch themes to another temporarily to clear the cache.
Method 6: (Nginx specific)
First make sure the upload_max_filesize, post_max_size and memory_limit has enough size. Open your php.ini file and change them if they are too low.
;This sets the maximum amount of memory in bytes that a script is allowed to allocate
memory_limit = 128M
;The maximum size of an uploaded file.
upload_max_filesize = 100M
;Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize
post_max_size = 200M
And then, open nginx configuration file. You can find it in
sudo nano /etc/nginx/nginx.conf or sudo nano /usr/local/nginx/conf/nginx.conf
Put this piece of code in http or server or location context to increase the size limit in nginx.conf:
# set client body size to 2M #
client_max_body_size 100M;
Method 7:
If the above methods doesn’t fix your problem try disabling your plugins one by one so that you can figure out if any one of them are causing the issue.
Still cannot figure out what is wrong? Send me an email to zubaer[at]wordpressinsights[dot]com and I shall try to help you.
Leave a Reply