WordPress Upload Http Error

Well I have been having a problem with my uploads

wordpress upload error

in this WordPress install and couldn’t figure it out until I checked the error log in apache. The error log had a very interesting entry that shed some light on this problem.

This is the error I found in the log:

client denied by server configuration .htaccess

When I looked in the file directory I found an .htaccess file with the following:

 

#BEGIN Wordfence code execution protection

<IfModule mod_php5.c>

php_flag engine 0

</IfModule>

AddHandler cgi-script .php .phtml .php3 .pl .py .jsp .asp .htm .shtml .sh .cgi

Options -ExecCGI
# END Wordfence code execution protection

 

So I removed the leftover Wordfence protection code and wouldn’t you know it, I can upload files again!

I haven’t had any errors in the apache log for so long I just plain forgot to check.

Wordfence should have removed this code when I removed the plugin. I didn’t have upload errors with the code in place until I switched the site over to HTTPS and upgraded PHP.

EDIT:

Ok so I did find another problem with HTTP errors in WordPress uploads. If you use plugins that automatically optimize images on upload then you can have a time-out problem on the server end. Especially with png files and usually no problem with jpg. So for my specific environment I set EWWW to not optimize as a image was uploaded but to later do an automatic conversion in the specific directories that I set, including the media folder.

I hope this helps  anyone that is having the HTTP error when trying to upload files to wordpress!

Leave a Reply

Your email address will not be published. Required fields are marked *