How to fix HTTP error when uploading files in WordPress

Recently, during the change of hosting I encountered a small problem, namely an HTTP error while uploading files. Certainly not only I had such a problem, so today I will show you how to fix an HTTP error while uploading files on WordPress.

1.  Try adding one of the following codes to your .htaccess file :

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

 

# 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>

 

AddType x-mapp-php5 .php ( at the very beginning of the .htaccess file )

 

The codes may vary from server to server, so if you are unsure, contact your hosting administrator.

2. If the problem occurred after installing one of the plug-ins, enable it and then try again. You can also try disabling all plug-ins at once to make sure that none of the installed plug-ins causes this problem.

3. Increase the PHP memory limit. Add the following code (‘WP_MEMORY_LIMIT’, ’64M’) to the file wp-config.php. This setting may not work if your provider does not allow you to increase the PHP memory limit, in this situation ask them to change the limit for you.

4. Make sure your hosting company is using PHP 5.2.4+. In the case of the DirectAdmin panel, you can check it yourself by selecting Advanced options -> PHP Global Settings.

5. If you use an additional plugin to optimize your photos, deactivate it and try changing the settings if it causes the problem. It is also possible that you will be able to upload photos in JPEG format, and the problem will only appear for photos in PNG format.

6. Make sure that there is no apostrophe in the name of the photo, e.g. (treno’vision.png), this can also cause an HTTP error.

If none of the described solutions have solved your problem, be sure to contact your hosting provider. However, I hope that the described methods have helped you solve this problem. If you know others, how to fix HTTP error while uploading files, then share them in the comment below.