Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

neophyte question w/win2k

by Anonymous Monk
on Nov 02, 2001 at 23:12 UTC ( [id://122890]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm just a tender young altar boy. Trying to get my first cgi script to run. os: win2k server: Xitami console version perl: ActivePerl 5.6.0.616 browser: IE5 code:
#!C:\Perl\bin print "Content-type: text/html\n\n"; print "Hello World"; #end script
The shebang line is the path to my perl bin folder. The script runs ok in a dos box. The script name is: hello.pl and is in C:\Xitami\cgi-bin If I point the browser to http://127.0.0.1/cgi-bin/testcgi it works and shows env. variables. But: If I point browser to: http://127.0.0.1/cgi-bin/hello then I get a default IE5 page saying there was a problem opening this pg. Also tried .../hello.pl. The priests have shaved my head there is no turning back. Please help - it must be simple. Thanks

Replies are listed 'Best First'.
Re: neophyte question w/win2k
by broquaint (Abbot) on Nov 02, 2001 at 23:16 UTC
    I think you want
    #!C:\Perl\bin\perl.exe
    as your shebang line, as Xitami will need to know what executable to use when running the script. Also you need to use the full path of the script to see any result - http://127.0.0.1/cgi-bin/hello.pl
    HTH

    broquaint

Re: neophyte question w/win2k
by thunders (Priest) on Nov 02, 2001 at 23:45 UTC
    First make sure that that your server works by typing http://127.0.0.1 into your browser. If you get an error page that that means the server isn't running and you have to start it. If your server is running, Run a script like this:
    #!perl use CGI; $x = new CGI; print $x->header, $x->start_html; print "Hello, World\n",$x->end_html;

    Did that work? your path on Windows should really only have to be #!perl </code>
    Update: to answer your question without advocating CGI.pm or assuming that perl is on your path.
    #!C:\Perl\bin\perl print "Content-type: text/html\n\n"; print "Hello World"; #end script
    will probably work just fine. you need to specifically mention the program in C:\Perl\bin that will be interpreting the program, which is of course called perl.exe. the .exe is not necessary, though.
Re: neophyte question w/win2k
by earthboundmisfit (Chaplain) on Nov 03, 2001 at 00:16 UTC
    Your Web server needs to be configured to serve perl scripts. Create a script mapping (I believe they call it a filter in the Xitami Administrator) for *.pl files and point it to C:\Perl\bin\perl.exe or wherever your Perl installation was made.
Re: neophyte question w/win2k
by Anonymous Monk on Nov 04, 2001 at 08:29 UTC
    I am up and running now. Thank you for the support.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://122890]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (1)
As of 2024-04-18 23:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found