Web Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignWeb Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old August 24th, 2004, 04:48 AM
finnpark finnpark is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 finnpark User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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


Reply With Quote
  #2  
Old August 9th, 2005, 08:17 AM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 542 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 2 h 49 m 17 sec
Reputation Power: 3
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Development > Apace PERL Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway