I encountered 500 internal server error when I tried to access a fresh Drupal 6 installation on a shared host.

The first error appeared on the index page immediately after the Drupal installation.  I did some search and found that some options of the default .htaccss file may cause this issue, here are the cause and solutions:

  1. If you had enabled the clean url feature on installation, the “RewriteBase” should be checked, make sure the path had been set accordingly.
  2. If the PHP handler runs as CGI mode,  some options in .htaccess file are not allowed, especially the “<IfModule mod_php*.c>” sections, comment them out and try to change the settings just in your php.ini file.
  3. Make sure “Options” overriding allowed by the host.

That’s the first 500 internal server error solutions I found and the #2 solution worked for me. Try your own way on the error raised.

The second 500 error appeared when I tried to access any of the image files I had uploaded to the sites/default/files/ folder. This is weird and need some tricky ways.

  1. Enter the sites/default/files folder, you can see the .htaccess there, shocked, right? I was.
  2. According the Drupal official documents, the file is there for security reasons, and Drupal always tries to create it if it’s not there, AND it will always have the same lines when created automatically.
  3. The .htaccess file has three lines, looks like this:
    SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
    Options None
    Options +FollowSymLinks
    Some host server may not allow the SetHandler option here, especially on some shared host.
    The “+FollowSymLinks” is not allowed on most of CGI mode shared host.
  4. I didn’t try to fix the problem by modify the file, just clear all lines and keep it blank. Maybe not professional, but works.

DO NOT remove the .htaccess file in the sites/default/files folder and try to get the result, it will appear again automatically, that’s by design.

Some possible reasons which could rise the 500 internal server error on Drupal site I’ve found:

  • PHP safe_mode is set on;
  • Drupal can’t access /tmp folder;
  • PHP memory limit is too low or run time limit is too short;

Recommendation: Try to contact with the hosting provider first before you buy their service, find out whether Drupal could run fluently.  Choosing a wrong hosting  provider is just waste your money.