Why are my Perl scripts failing with ’Error 500: Internal Server Error’?
If your Perl script is returning an Error 500, there are a few steps you can take to find out what the problem is.
FTP Settings
Section titled “FTP Settings”Check that you have uploaded the script through FTP in ASCII mode, not Binary.
Interpreter Path
Section titled “Interpreter Path”Make certain that the interpreter path on the first line of the script is:
#! /usr/bin/perl
File Extension
Section titled “File Extension”Ensure that the script’s filename ends In either a .pl or a .cgi.
File Permissions
Section titled “File Permissions”All scripts should have a file permission of 755 or rwxr-xr-x. This means that the owner can read, write, and execute the script, and all others can read and execute the script.
Print Errors to Browser
Section titled “Print Errors to Browser”In the second line of your script (after the interpreter path), put this line:
use CGI::Carp qw(fatalsToBrowser);
This prints the error in your browser window instead of the existing ‘500 Internal Server Error’ page.
Check the Error Logs
Section titled “Check the Error Logs”In your eXtend Control Panel, you can check the error logs for your site in ‘Log File Download' under 'Web Stats & Logs'.