fix 500 internal server error

Thursday, January 5, 2012

There are many reason for internal server error, first thing you need to do is check the error.
Whether it is Server error or error in script.

To check error, please replace your index page code with follwing one:

#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "testing...\n";


If index web page does not show text "testing", then you can considered it is a server problem and you need to contact hosting provider, Otherwise you can resolve this issue yourself by reading this articles,

1. change your cgi directory permission to 755, Similarly if your script is at .../cgi-bin/foo/bar.cgi, the foo directory must not be world-writable (0777).  
(Note folder permission always should be 755 not 777)



2.Transfer modes: if you are using FTP to transfer the CGI script to your server, then your FTP client is probably set to AUTO transfer mode; that is, it will try to figure out whether to use BINARY or ASCII mode without asking you.  But depending on whether your CGI script came from a Windows or UNIX system, and whether it's going to a Windows or UNIX system, you may need to manually set your FTP client to use either ASCII or BINARY mode before transferring your CGI script.  Try one and then the other.


3.Line endings: the cause of the transfer-mode problem is actually another problem in itself: different types of Operating Systems (namely, Windows vs. UNIX/Linux/everything) use different character codes to represent line-endings.  If your server is a UNIX server, but you're editing your CGI script on a Windows computer with a text-editor that doesn't use UNIX-style line-endings, it'll cause problems.  Applications like GoLive and Dreamweaver sometimes get this wrong.  Even built-in editors can't agree: WordPad (not Word) seems to get it right while Notepad messes it up.  So try opening & saving your CGI script in a different text editor and uploading it to the server again.

1 comment

 

Most Reading

Sidebar One

+1-800-574-0902 +44-20-7993-2673 (ID: 173296)