Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

CGI as text on IIS

by sulfericacid (Deacon)
on Apr 16, 2004 at 22:15 UTC ( #345890=perlquestion: print w/ replies, xml ) Need Help??
sulfericacid has asked for the wisdom of the Perl Monks concerning the following question:

This may not be the most suitable place for this question, but I asked in the CB and no one said they minded..

I just installed the IIS server today on XP (don't comment on Windows, commenting on something other than the question or topic at hand is just a waste!) and I can get HTML and ASP files to work. I went to test a CGI but instead of executing, it pretends it's a text file instead.

If I have perl setup on my system, do I need to install it again for the server? Does anyone have any ideas what I need to do to get them to work properly?

One other thing.. I'm not running it specifically from a cgi-bin folder, but I'm thinking that has nothing to do with it. Thanks everyone.



"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

sulfericacid

Comment on CGI as text on IIS
Re: CGI as text on IIS
by gjb (Vicar) on Apr 16, 2004 at 22:22 UTC

    You don't mention what Perl distribution you've installed, but I'm guessing it's ActiveState. If so, running the installer again will allow you to install Perl for ISAPI so that your IIS speaks Perl "better".

    Hope this helps, -gjb-

Re: CGI as text on IIS
by bmann (Priest) on Apr 16, 2004 at 22:38 UTC
    You will need to configure IIS to execute perl scripts with perl.exe (it may have already been done by the installer), then you will need to configure a folder that allows this execution.

    You can find a step-by-step answer at activestate here in their windows faq.

Re: CGI as text on IIS
by neniro (Priest) on Apr 17, 2004 at 13:17 UTC
    Yes, you need to install perl on your server. You can additionaly add the following firstline to your scripts:
    #!c:/Perl/bin/Perl.exe
    If Perl is correct installed, this isn't necessary. It seems to be only needed for win32-apache, not for IIS. It is also a good idea to add index.pl or default.pl to the lists of standard documents.
Re: CGI as text on IIS
by perleager (Pilgrim) on Apr 17, 2004 at 22:18 UTC
    Hey,

    When you say you have Perl set up on your system and that meaning you have ActiveState Perl installed correctly then my suggestion is this:

    Goto your Administration tools, and click Internet Service Manager. Find your website listed, and then click its properties. Click "Home Directory" tab and click the button called Configuration. After that, click the add button to add a extension.

    Type .pl or whatever your planning to run most of your scripts as and then add the path:

    c:\perl\bin\perl.exe %s %s

    Also, if your planning on using taint mode for your scripts, might want to add another extensions called .plt or something and add the path: c:\perl\bin\perl.exe -T %s %s

    From there, I'm pretty sure your system would recognize .pl files to be an perl script and to be executed by the Perl interpreter.
    I once had a similar problem where when trying to run a perl script through the browser, it'll recognize it as a text file and offer to download it rather then execute it.

    Anthony

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2014-10-01 16:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (29 votes), past polls