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

Please forgive me for the following probably off-topic post. Truth be told, I have grown rather desperate.

Behold the very early stages of an aspiring Webmaster...

-- I'm attempting to modify a website under Microsoft's Internet Information Server 4.0.

Specifically, I'm trying to set things up so that when a particular perl script is requested, what is returned is not the script itself, but the output of that script, instead. Basic CGI, right?

I thought I had it done, but when I type the address into my browser, this error message is returned:

"CGI Timeout The specified CGI application exceeded the allowed time for processing. The server has deleted the process."

The timeout is set to 90 seconds (by right-clicking the website in IIS and going to Properties, then the "Web Site" tab.) This script simply outputs the HTML to produce a page that says "Hello World." It does NOT take more than 90 seconds to run.

I have associated the .pl extension with the full pathname to the Perl executable. (By right-clicking the subdirectory containing the script, clicking the radio button giving the directory script permission, and under the "Configuration" button, adding the .pl:<path>/Perl.exe application mapping.) The necessary libraries (Perl56.dll) are in the same directory as the executable. The script runs fine from a DOS prompt. Hell, it LOOKS like valid HTML.. Here is the output:

HTTP/1.0 200 OK Content-Type: text/html <HTML> <HEAD> <TITLE>Hello World</TITLE> </HEAD> <BODY> <H4>Hello World</H4> <P> <P><H5>Have a nice day</H5> </BODY> </HTML>
I am distressingly unfamiliar with IIS, and I can't imagine what else it wants.

Is there something obvious I'm overlooking? Am I leaving anything out? (Just ask -- _please_ ask.)

Again, I apologize that this isn't a question about coding in Perl itself, but it is about getting Perl to run.. and a solution would also go a long way toward causing another company to run Perl on its server, which is good, right?

--
Can an atheist be insured against acts of God?

Replies are listed 'Best First'.
Re: I can't get Perl to run on MS-IIS! Help!
by ryddler (Monk) on Jan 23, 2001 at 04:01 UTC
    I'm guessing that your mapping still isn't set up completely. On your configuration page the path to your perl executable should look like this:
    c:\perl\bin\perl.exe -T %s %s

    This is similar to an answer given here that illustrates setting it up through the registry, but you can also do it through the application configuration like you did.

    The -T turns on taint checking which you should always use for a public server.

    ryddler

Re: I can't get Perl to run on MS-IIS! Help!
by Fastolfe (Vicar) on Jan 23, 2001 at 05:06 UTC
    Firstly, you should not be printing out the HTTP/1.0 200 OK message yourself. CGI is not HTTP. The first line your script outputs should be that Content-Type line. Everything else looks fine. Be sure you have autoflush turned on ($|=1). If you continue to have problems, it's likely with your IIS/Perl setup. I don't know how much use we can be, since mostly this site is about Perl as a language. If this is ActivePerl, have you contacted ActiveState or taken a look at their support site?
Re: I can't get Perl to run on MS-IIS! Help!
by Lexicon (Chaplain) on Jan 23, 2001 at 07:14 UTC
    Here's some random ideas, although this is hard to discuss without seeing the server itself. This is about the minimal code you need for the CGI to work.
    print "Content-Type: text/html\n"; #Tell browser it's html print "\n"; #IMPORTANT-End of header. print "Hello World"; #Output

    It works on my server (IIS4/Activestate), so if it doesn't work on yours, then you know the problem is in configuration. Otherwise you should post your code.

    Oh, and this is named HelloWorld.cgi on my server. See if the .cgi extention works (it may need to be in the cgi-bin directory, I forget)

    -Lexicon

      Did you meant text/plain?
      print "Content-type: text/plain\n\nHello World";
      is about as minimal as it gets.
Re: I can't get Perl to run on MS-IIS! Help!
by BigJoe (Curate) on Jan 23, 2001 at 18:34 UTC
    If you use the latest version of Activestate perl this will automatically configure it for you. Just make sure your filenames end in .pl

    --BigJoe

    Learn patience, you must.
    Young PerlMonk, craves Not these things.
    Use the source Luke.