Fix “500 Internal Error” in WordPress

I recently upgraded my WordPress installation to the latest version (2.8.6) and started running into issues with uploading images. Every time I tried using the Flash Uploader I would see

HTTP Error.

On trying to use the non-flash browser based uploader, I saw the following:

Error 500 – Internal server error
An internal server error has occured!
Please try again later.

I googled quite a bit and finally found a solution. This error can happen because of quite a few different reasons:

  1. Incompatible plugins
  2. Incorrect .htaccess file contents
  3. PHP running out of memory
  4. Incorrect file permissions
  5. Not using PHP5

Incompatible plugins

Easiest way to find if this is the issue is to deactivate all plug-ins and see if the issue still persists. If it goes away you can activate each plug-in one by one to find the culprit. You can read more on managing plug-ins here.

Incorrect .htaccess file contents

For some people, the issue went away after fixing the .htaccess file contents. You need to ensure that the .htaccess file at root of your website has the following contents:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

You can read more about it here.

PHP running out of Memory

This can happen if you are using some memory hungry plug-ins. You can fix this issue by adding a php.ini file in <wordpresss_root>/wp-admin folder with the following contents:

memory=20MB

You can read more about this at codedifferent.com, where this is explained in more details.

Incorrect file permissions

WordPress can start acting up if the permissions on directories and files in WordPress installation aren’t set up properly. You can ensure that this is fixed by logging into your hosting provider and making sure all files and directories have permissions set to 755.

Another issue that might lead to errors while uploading is certain security issues with files used for uploading. This can be fixed by using Image Upload HTTP Error Fix plug-in. Otherwise, you could edit .htaccess to add the following lines:

#BEGIN Image Upload HTTP Error Fix
<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>
<IfModule security_module>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>
<IfModule security2_module>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>
#END Image Upload HTTP Error Fix

Not using PHP5

Even after doing all the above, things weren’t working for me. That is when I came across this post, which explains that the issue could be because PHP5 wasn’t enabled. According to a help article on 1and1.com, fix is to just add the following line in .htaccess file:

#enable php5
AddType x-mapp-php5 .php

This fixed the issue for me!

Hope this helps.

9 Replies to “Fix “500 Internal Error” in WordPress”

  1. I had a similar issue updating to WP 3.01 at 1&1. I only got errors on the ios WP app for iPhones, but I wasn’t able to see any of my published posts on my iTouch.

    Thank you for the article! Too bad 1&1 still has issues with WP blogs … It was the last solution that fixed it for me – the PHP5 info in the .htaccess file.

Leave a Reply

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