Web Hosting Talk







View Full Version : running a perl script throws internal 500 error.


jjk2
12-23-2008, 03:41 AM
i tried running something like this, and when i run in browser, i get internal 500 error. but when i run it in commandline, it works fine. perl test.pl
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print <<END_HTML;
<html>
<head></head>
<body>Hello, World!</body>
</html>
END_HTML
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, 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.

Codebird
12-23-2008, 06:39 AM
1- script may contain errors
2- script should be executable chmod 755
3- if both doesn't work contact your hosting provider

cygnusd
12-23-2008, 12:34 PM
Also, try to check Apache (or your webserver's) error logs. You'll probably see some message there to help you troubleshoot the problem.

zacharooni
12-23-2008, 10:15 PM
Try making it:
#!/usr/bin/perl -w
Also, make sure you have this in .htaccess in the cgi-bin directory:
Options +ExecCGI