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

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"


Replies are listed 'Best First'.
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 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 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:
    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 or to the lists of standard documents.
Re: CGI as text on IIS
by perleager (Pilgrim) on Apr 17, 2004 at 22:18 UTC

    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.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://345890]
Approved by gjb
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2017-03-28 03:10 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (326 votes). Check out past polls.