Hello Everyone. I have a problem trying to get “Hello World” PERL program running on my cgi-bin apache server. Im using Apache on Windows XP. The CGI-bin seems to be configured ok. There was a default PERL script there called printenv.pl. This was executed from local host
http://localhost/cgi-bin/printenv.pl . The page below was the result:
COMSPEC C:\WINDOWS\system32\cmd.exe"
DOCUMENT_ROOT="C:/Program Files/Apache Group/Apache2/htdocs/"
GATEWAY_INTERFACE="CGI/1.1"
HTTP_ACCEPT="text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"
HTTP_ACCEPT_CHARSET="ISO-8859-1,utf-8;q=0.7,*;q=0.7"
HTTP_ACCEPT_ENCODING="gzip,deflate"
HTTP_ACCEPT_LANGUAGE="en-us,en;q=0.5"
HTTP_CONNECTION="keep-alive"
HTTP_HOST="localhost"
HTTP_KEEP_ALIVE="300"
HTTP_USER_AGENT="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3"
PATH="C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS; C:\WINDOWS\System32\Wbem"
PATHEXT=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.W SF;.WSH"
QUERY_STRING=""
REMOTE_ADDR="127.0.0.1"
REMOTE_PORT="3383"
REQUEST_METHOD="GET"
REQUEST_URI="/cgi-bin/printenv.pl"
SCRIPT_FILENAME="C:/Program Files/Apache Group/Apache2/cgi-bin/printenv.pl"
SCRIPT_NAME="/cgi-bin/printenv.pl"
SERVER_ADDR="127.0.0.1"
SERVER_ADMIN="hidden@hidden.ie"
SERVER_NAME="localhost"
SERVER_PORT="80"
SERVER_PROTOCOL="HTTP/1.1"
SERVER_SIGNATURE="<address>Apache/2.0.50 (Win32) Server at localhost Port 80</address>\n"
SERVER_SOFTWARE="Apache/2.0.50 (Win32)"
SYSTEMROOT="C:\WINDOWS"
WINDIR="C:\WINDOWS"="
Ok this seems well. However when I try to run my “hello world” PERL script or any other example script I get the following webpage:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, hidden@hidden.ie 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.
Apache/2.0.50 (Win32) Server at localhost Port 80.
The printenv script always works ok-this was there when I installed apache. However any script I write myself gives the above error. An example of my “hello world” script is below:
#!c:/Perl/bin/Perl.exe
print "Content-type: text/html\n\n";
print "<h2>Hello, World!</h2>\n";
Any advice would be appreciated. Is it to do with file permission? Please note that I did not change anything in the httpd.conf file. Should I have done something to configure it to allow cgi-bin to be used?
Thanks