Saturday, November 24, 2012

Perl Script gives 500 Internal server error on shared hosting

Perl script throws error...

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@yourdomain.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Following steps need to solve problem
Just try following code with test.pl...with execution permission (755) on folder (cgi-bin) www.yourdomain.com/cgi-bin/ and file test.pl
#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "testing...\n";


and if it works than no problem with server side configuration.

If not works than add -w in first line...
#!/usr/bin/perl -w
if not works than it may server configuration problem

Got clue from... http://encodable.com/internal_server_error/ Thanks to them.

No comments: