http://www.perlmonks.org?node_id=118099

gary kuipers has asked for the wisdom of the Perl Monks concerning the following question:

I've installed Perl build 629 on a win 2000 box which has IIS 5.0.
 
1) perl -v works
2) the command "perl program.pl" gives the expected output of program.pl
3) a link to program.pl opens a dos session very briefly, outputs the same as #2 above and then closes.
 
It is as if perl is not piping its output to IIS for it to serve or that IIS is launching the program correctly but is not capturing its output.
 
I think I installed the perl interpreter correctly in IIS. It is:
.pl e:\...\perl.exe %s %s  
Any clues? Thanks!
Gary

Replies are listed 'Best First'.
Re: Perl under Win 2000 & IIS 5.0
by earthboundmisfit (Chaplain) on Oct 11, 2001 at 00:28 UTC
    You might want to check out Cannot run Perl under IIS or this.

    Check to make sure you have E:\Perl (or whatever is appropriate for your isntallation) in your PATH environment variable.

    Also, you need to have the same .pl extension defined at the OS level (file types within the folder options applet)

Re: Perl under Win 2000 & IIS 5.0
by pitbull3000 (Beadle) on Oct 11, 2001 at 01:05 UTC
    be sure you set up your virtual web directory correctly,
    in which your cgi scripts are running. you have to assign
    that directory the propper rights to run these scripts.

    with your installation should be everything ok, cause the
    installer from activeperl works very fine.
    but the best would be, if you tell us the error message
    you get when you try to access the script.

    pitbull3000
      I uninstalled Perl and reinstalled it. Same behaviour. Perl works from the command prompt.
       
      Here's the error when I click on the link:  
      "you have chosen to download a file from this location ..."
       
      The virtual directory where the perl script resides has:
      script source access - OFF
      read - ON
      write - OFF
      Directory browsing - OFF
      log access - ON
      index this resource - ON
       
      IIS seems to be configured to think a .pl is a downloadable file. This even though the "Home Directory - Configuration - Application Configuration clearly has:
      Extention - .pl
      Executable path - e:\perl\bin\perl.exe -T %s %s
      Verbs - (all)
       
      One can actually download the source if one says "save" when the download window is presented. If one choses "run from this location" a DOS box opens, shows the output of the execution and then closes.
        Contents of your PATH env var? E:\Perl\bin\ needs to be in there.

        You say that the script mapping is configured a certain way, but have you checked to make sure it is defined both for the top level and the server instance below? The top level in the IIS Manager is the machine name. Server instances run under it in the tree display of the Manager and is named 'WWW Server' by default. Perhaps you have the top level script mapping defined, but there is an anomaly in the server instance.

        Try perl -V and check to mak sure the @INC paths are right.

Re: Perl under Win 2000 & IIS 5.0
by converter (Priest) on Oct 11, 2001 at 05:29 UTC
Re: Perl under Win 2000 & IIS 5.0
by blacksmith (Hermit) on Oct 11, 2001 at 18:00 UTC