|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Apace PERL Problem
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:\WIN DOWS\System32\Wbem"PATHEXT=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.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 |
|
#2
|
||||
|
||||
|
running perl
Your post shows that
"executed from local host http://localhost/cgi-bin/printenv.pl" works (it shows environment values) But that your file with this script Code:
#!c:/Perl/bin/Perl.exe print "Content-type: text/html\n\n"; print "<h2>Hello, World!</h2>\n"; does not work. I found this example "hello" script online Code:
#!/usr/local/bin/perl print "Hello, world!\n"; Differences noted include The example does not start with Perl but usr not end with an exe file is not presenting HTML I think if you tried changing your first line to that of the example, and put the file into the same folder as printenv.pl, and called the file from a link, it may just work. |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Web Development > Apace PERL Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|