How to Solve Magento 500 Internal Server Errors

How to Solve Magento 500 Internal Server Errors

Many users encounter some weird Magento 500 Internal Server Errors (Error type 500). I will try to list the most common solutions. These errors are not always caused by the same reason. You should try to take a look at your server’s error logs to get some help about this error.

You can get additional info about the errors by Turning on Developer Mode. Look in the Magento bootstrap file (index.php), you’ll see lines similar to the following

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

Uncomment these. In a production system, you’d never want to have your errors display to the browser, but while developing having an errors and warnings thrown immediately in your face is invaluable. 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.

Solution #1

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 index.php file from 664 to 644.  Also change the permissions of downloader/index.php file to 644 as well otherwise when you will try to access System > Magento Connect >Magento Connect Manager (after magento installation) by logging to magento admin,  you will get 500 Internal Server Error.

You can also try this tool, it’s a magento cleanup utility. It will set the correct permissions for your complete magento installation:

  1. Download it
  2. Unzip magento-cleanup.php to the root directory of your magento installation
  3. Browse to http://yourdomain.com/magento/magento-cleanup.php

Solution #2

Your server does not support some of the magento specifications. You can easily test this using the magento check utility. Follow the steps below to check your server’s software, if there is an incompatibility this utility will show it.

  1. Download it
  2. Unzip magento-check.php to the root directory of your magento installation
  3. Browse to http://yourdomain.com/magento/magento-check.php

Solution #3

If you are getting weird 500 internal server errors on specific pages of your site, it might be a matter of resources. I was getting internal server erros on some product pages and on the http://yourdomain.com/checkout/onepage. I found out that the .htacess file of my magento installation was somehow reset and the php_value memory_limit value was set to 32M as soon as I raised it, the internal server errors vanished! You should use at least 256M for over 600-700 SKUs. Magento is very resource hungry and it is easy to get these kind of errors if you try to save some bucks from the hosting.

Solution #4

Htaccess file which is located at Magento root folder. It will be this case if you meet Internal Server Error on every page. Try to remove it for testing purpose
If your website was running file for a long time, then it must be a change at Server side, just submit a ticket to Hosting Company.

Solution #5 (Comment from Huberto)

If the curl extension is missing you can get 500 Internal server error. You can install it using the command below:
apt-get install curl libcurl3 libcurl3-dev php5-curl


Panagiotis Tzamtzis is the founder of TechJam. You can reach him on Twitter, LinkedIn, Facebook, Google+

42 Comments

  • Mohsin - 20/11/2012

    Hi
    Your first solution worked 4 me.
    Thanx

    Reply
    • Chris - 16/11/2014

      Yes, it worked, using Solution #1.

      As I am a amature running Magento 1.9.0.1, I did a backup database from System>Tools>Backup> Database and Media Backup, after running that it went blank and the next thing I know, it appears Internal server 500.

      Lucky for this tutorial here, it’s up and running again. I was having cold sweat for the past few hours looking for solution and getting help.

      Never run the back up in the Magento itself.

      Kudos to TeachJam!

      Reply
  • Salil Kalghatgi - 21/01/2013

    Solution 4!!!!!!
    I had magento running on a subdomain with Joomla on the main domain. tried all the database, memory, and permission configs, deleting the magento .htaccess worked like a charm. thanks a lot

    Reply
  • ville - 16/02/2013

    Solution 4 work for me.

    I delete .htaccess file.

    Is there any reason to but it back to root folder? Does the website need it for some reason to to work?

    Reply
    • TechJam - 16/02/2013

      Yes, the htaccess file is used to set php variables, permission settings and many other important stuff.

      Reply
    • Anderson Possamai - 08/07/2013

      For me too! Magen CE 1.7

      Reply
  • Humberto - 15/03/2013

    Hi,

    If the cURL extension is not installed, you receive an error screen 500 in admin.

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

    Reply
  • Vinicius - 27/03/2013

    First tip of enabling error messages was the key to solve my problem. I would never figure out that I had to make the ENTIRE /var directory writable (including its contents). Magento Wikis and instructions doesn’t say that.

    Reply
    • Cindy - 07/10/2014

      I had a problem where my website cannot be indexed by Google and returned error 500.
      The above comment worked for me. But can somebody PLEASE explain to me why merely enabling the error message fixed crawling error?

      Thanks!

      Reply
  • Tudor - 28/03/2013

    Thank you man! The solution with magento-cleanup tool worked like a charm.

    Reply
  • Markus - 16/05/2013

    I have internal server error (500) when click for example on Google search on product url… but if I see the page product from site from categories and then to click on the same product and the same url.. the url product page is ok.. The magento site is in multistore, the rewrite url is active, the php_value memory_limit is to 256 MB.. The is on external click of url but only the product url: http://www.domainname.com/en/nome-prodotto.html, the click on page url not direct for example http://www.domainname.com/en/name-categorie/name-product.html is ok. The canonical option is active. Can you help me?

    Reply
    • TechJam - 16/05/2013

      if you want you can send a couple of actual links with this to my email and I can try to take a look ;)

      Reply
      • anil - 29/05/2013

        hello !
        I had install magento 1.8.0.0 alpha version ,after using it for 30 min ,
        I am facing some problem after clicking the manage category option in catalog ,on clicking the manage category the next page which is supposed to be manage category page where we can add ,edit the category will come but i found some other kind of stuff …this stuff contains a page with field like…page 1 of pages

        Reply
        • anil - 29/05/2013

          i have a snapshot of that other page please help to get over this error

          Reply
          • TechJam - 31/05/2013

            Hi, I’m not sure what your problem is. if you send me a url I can take a look…

  • deko - 23/05/2013

    Cleanup tool worked like a charm
    Thanks

    Reply
  • Matthias - 27/09/2013

    Hallo,

    got the same issue on the downloader.
    For me the solution was a to high memory_limit. I think suhosin don’t like it. So I reduced the memory limit to 1024M and everything works.

    Cheers,
    Matthias

    Reply
  • Dan - 29/09/2013

    Thank you man. You helped me a lot.

    Reply
  • Gerardo - 30/09/2013

    Hello, like everyone else in this post im stuck on that 500 internal server error. Last weekend i add my paypal account info, and everything was great. Like 1 hour after that i was changing some .cvs fiiles and then the nightmare started.

    Every time i try to buy something everything is ok until my shopping cart webpage, once there when i press the PROCEED to CHECOUT, i get this error.

    Fatal error: Class ‘Mage_Checkout_Controller_Action’ not found in /var/www/vhost/goclick.es/home/html/staging/app/code/core/Mage/Checkout/controllers/OnepageController.php on line 29

    I have magento 1.7.0.2, and well, if anyone here have an idea about what to do i want to thank you in advance. o.o /

    Reply
  • pritesh - 19/10/2013

    thanks solution1 saved my day..thanks a lot buddy

    Reply
  • Glenio de Lima Teodosio - 26/11/2013

    1ª Solução perfeita. Parabéns e obrigado !

    Reply
  • kiran - 27/12/2013

    great article,very help full , thank you for Solution #1 :)

    Reply
  • Marcelo Rocha - 31/01/2014

    Thank you very much! The permission tool works greatly!

    Reply
  • Ilian - 24/02/2014

    Thanks! very help full , thank you for Solution #1

    Reply
  • Leonardo Oliveira - 05/03/2014

    Thanks! You saved my neck with this solution!

    Reply
  • Timeout - 07/04/2014

    Hey there, thanks for the fixes. Many 500 Internal Server Errors occur if you have some files missing. I’ve met alot of these 500 Errors, and most of the time there were a files missing.

    Check your app/code/core folder for missing files, this often helps!

    Thanks for the file which fixes the permissions. Helped for me!

    Reply
  • Dan - 20/05/2014

    Hi, thanks for this article. I in the first solution you suggest changing permissions for the downloader/index.php I changed the perms to 0644 form 0777, and I cleared the Magento Cache, but I still get the 500 error when trying to access the Magento Connect Manager, this is the only error message I get.

    Is there anything else I can do to try and clear this issue, I really need to install an extension, and I cannot do this until I get the Magento Connect Manager working…any ideas would be warmly received.

    Reply
    • Dan - 21/05/2014

      I have now managed to solve the problem for myself. Although I got the exact answer from another source, this article prompted me to look in the right place, so thanks for that. :)

      Reply
  • Dan - 21/05/2014

    Looks like someone has stolen your article….

    http://minhnvt1.wordpress.com/2013/08/19/magento-solved-internal-server-error-500-error/

    Reply
    • TechJam - 22/05/2014

      Thanks for the heads up Dan. Although it would have been nice to refer the original link :) It’s fine. Let’s share the knowledge :)

      Reply
  • himanamangas.blogspot.com - 07/06/2014

    Good replies in return of this matter with solid arguments and explaining
    all concerning that.

    Reply
  • Bhushan - 21/06/2014

    A great post. Thanks man.

    Reply
  • SPH - 02/08/2014

    I am so happy i came across your solutions… i was just having 500 errors all the time and i was sick of it.
    Thank you so much!!

    Reply
  • Sarfaraz - 07/08/2014

    Hi Dear

    I am new to mangento, and face problem of exporting 4499 products via system, dataflow, export all product but get 500 error.
    I check many solution but did not work for me. kindly let me know what is problem

    reply me please on sarfaraz@qh-enterprises.com

    Regards

    Reply
  • Michael Bos - 18/08/2014

    I really like this and it has helped me during some of my troubleshooting sessions. Especially Solution 3 & 5 where head breakers I forgot.

    Do you mind If I translate this to Dutch and put it on my site?

    Thank you,

    Reply
    • TechJam - 22/08/2014

      No problem. Just mention the URL as the source :)

      Reply
  • David P - 02/09/2014

    Thanks so much for this post – solution 1 worked a treat!

    Reply
  • jagadish - 24/09/2014

    Thanks . This post was really helpfull. Keep posting.

    Reply
  • Nirav Sheth - 31/10/2014

    Pretty much valuable info! Solving Magento 500 internal server errors, explained in such easy-to-understand dialects; explanation given on is much detailed as well; appreciate it.

    Reasons behind it are not same all the time; seeing the server’s error logs can certainly be a big help to us; yes finding some anonymity; great!

    Reply

1 Trackback

Leave a Reply