Why does my script display an "internal server error" message?

The most common reason for an Internal Server Error message is that you've uploaded a script in the wrong "mode" in your FTP program. In particular, Perl, Ruby and Python scripts should always be uploaded in "ASCII" or "text" mode, not "binary" mode.

Our CGI Script Checker will tell you if a script has been uploaded in the wrong mode. If that's the problem, see the documentation that comes with your FTP program to learn how to change the mode, then re-upload your script.

(The Script Checker can also catch other common problems, such as the first line of the script having the wrong "path". Always try the Script Checker first if you have trouble.)

Viewing the error log

You can often find more details in the error log for your site. To view recent lines from the error log:

  1. Login to the “My Account” control panel (having trouble?)
  2. Click Statistics and Logs
  3. View the “Web site error logs” section

(Older error log entries are also available via FTP or the Unix shell.)

Getting more information for Perl or Python scripts

If that didn't help, and your script is a Perl or Python script, you can modify the script slightly so that your Web browser shows you the actual error.

For detailed instructions, see the sections of our Perl page and Python page that discuss internal server errors. We also have extra tips on debugging Perl scripts.

Other causes of internal server errors

Another common cause of "internal server error" messages is creating a .htaccess file that contains syntax errors or unsupported commands such as "php_value". If you've created a .htaccess file, try removing it to see if that solves the problem.

If that doesn't help, the file may have incorrect "line endings". It's possible to convert the line endings to fix this.