Many users encounter Magento 500 Internal Server Errors (Error type 500) when they make updates to their site’s design or plugins without any significant experience, or just by computer error.  A majority of the errors we are asked about are common and the most common cause seems to be the Magento Downloader plugin (accessible via Magento Connect).

You should always try to take a look at your server’s error logs to get some help about this error before continuing.  You can get additional information about the errors by turning on ‘Developer Mode’.  Look in the Magento bootstrap file (index.php) using your FTP program and you’ll see lines similar to the following;

#Mage::setIsDeveloperMode(true);
 #ini_set(‘display_errors’, 1);

Uncomment these and save and update your PHP file.  In a production system, you would never want to have your errors display on the browser screen and to your users, but while you’re working on it, having errors and warnings thrown immediately in your face is invaluable in fixing the problem.  This way, you will see the actually problem which lead to the Internal Error Server.  In almost cases, the reason is that there is an exception throw after output is sent to browser.

What we’ve written here is only a guide, and we can’t take any responsibility for any problems it might cause you.  Always take a backup before updating or working with Magento!

 

Cause One: Permissions

This error might be caused because you have not set the correct permissions for the Magento folders.

To solve this go to File Manager and then change the file permission of the index.php file from 664 to 644.  Also change the permissions of the index.php file in the ‘downloader’ folder to 644 as well otherwise when you will try to access System > Magento Connect >Magento Connect Manager (reached after installation) by logging into the Magento admin dashboard,  you will get 500 Internal Server Error.

You can also try this tool, it’s a Magento Cleanup utility.  It will automatically set the correct permissions for your complete Magento installation, provided there is necessary administrative permission.

  1. Download it here
  2. Unzip the ZIP file to the root directory of your Magento installation
  3. Browse to http://yourdomain.com/magento/magento-cleanup.php and let it work

 

Cause Two: Specifications

Your physical web server does not currently support some of the Magento specifications – this fault will usually be displayed before you can access the installation and is common when you have installed the software using an automated installer.  You can easily test this using the Magento Check utility we have below.

Follow the steps below to check your server’s software, if there is an incompatibility this utility will show it;

  1. Download it here
  2. Unzip the ZIP file to the root directory of your Magento installation
  3. Browse to http://yourdomain.com/magento/magento-check.php and the results will be displayed

This utility can’t fix the problems, but it will identify them to allow you to work on repairing these.  You may need to speak with your hosting provider for more help.

 

Cause Three: Resources

If you are getting 500 Internal Server errors on specific pages of your site, it might be a matter of server resources or rather the lack of them.  You may be getting Internal Server errors on some product pages only and commonly on the http://yourdomain.com/checkout/onepage module.

Sometimes the .htaccess file of the Magento installation can somehow be reset and that the php_value memory_limit value can change.  As soon as you raise it, the 500 errors should vanish!  Remember, you should use at least 256M for over 600-700 SKUs.  Magento is a very resource hungry bit of kit and it is easy to get these kind of errors if you try to save some money on the hosting package or do not have a dedicated web server.

 

Cause Four: Htaccess file errors

As with most web software, there is a file in the root directly known as an .htaccess file.  If you are experiencing a 500 error on every page this could be the problem.  Try removing it from the root directory (but don’t delete it, you’ll need to put it back later) and see if it helps.  If it has been running for a long time and has now changed, your hosting provider might have made a change at their end and should be able to help you correct it.

 

Cause Five: Maintenance mode

To stop visitors from accessing the site while it’s being updated or modified.  The maintenance.flag file in the root directory causes the site to display a maintenance mode page to visitors.  It also changes the permissions of index.php from 755 to 666 to it from being executed (run) by web clients and browsers.

When Mage_Downloader updates the software, it can stop before the file permissions are reversed; and sometimes stops before the maintenance flag file is removed.  This can sometimes be caused by resource issues on your server, interruptions to the browser window or network connection.

To get your site working again, use your File Manager (web server based) or FTP program to browse the installation files and make the following changes:

  1. Navigate to the Magento root directory
  2. Delete the maintenance.flag file
  3. Change the file permissions for index.php from 666 to 755
  4. In the cart’s download directory (usually found as downloader, change the permissions for index.php from 666 to 755)
  5. Refresh the Admin Dashboard page or store’s front page in your web browser

 

Cause Six: Curl missing

If the Curl extension is missing within your Magento installation you can get 500 Internal server errors.  You can install it using the command below:

apt-get install curl libcurl3 libcurl3-dev php5-curl

 

Still not working?

We know that a lot of the information on this page will only help an advanced user so if you’re not comfortable at tackling the problem or not sure – talk to us, we might be able to help.  Either email us or send us a message online using our contact page.