in reply to #exec in SSI

Have you tried renaming your script 'mycode.cgi'? Some servers insist on the 'cgi' extension in SSI.

Replies are listed 'Best First'.
Re: Re: #exec in SSI
by jimac (Initiate) on May 08, 2002 at 13:51 UTC
    No, the server is configured to associate the .pl extension to perl.

    The IIS 5.1 documentation says that a #exec'd CGI program must send HSE_STATUS_PENDING when it terminates or the server will hang indefinitely.

    This is what is happening. I just don't know how to send HSE_STATUS_PENDING.....

    Jim.

      I've just had a look at the IIS 5.1 documentation on MSDN, and your interpretation of what is required isn't the same as what I've just read.

      http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/html/psdk/asp/serv9i5h.asp

      Specifically:

      The SSI interpreter (Ssinc.dll) will wait indefinitely for applications returning HSE_STATUS_PENDING unless the ServerSupportFunction is called to finish the session.

      So I don't think you want to return HSE_STATUS_PENDING. If you did, another site indicated that the correct value for this is 3. HSE_STATUS_SUCCESS is 1. Your problem sounds like a configuration issue to me, but I do not work with IIS so I really don't know. I've used SSI exec with Apache and never had any problems.

      Not that I know much about web servers, etc., but a Google search led me to think that HSE_STATUS_PENDING is a response associated with ISAPI, rather than CGI.

      You've probably looked at all this, but IIS configs for scripts as CGI vs scripts for ISAPI seem to be addressed at various places:

      Could it be that an additional or corrected IIS config would bypass the need to programmatically send this flag?

        You may be right, and I found the same references to ISAPI (specifically, how to handle HSE_STATUS_PENDING in ASP).

        However, the SSI #exec makes a distinction between executing via CGI and EXE, so I assume that it will handle CGI.

        It may well be that it is not possible to #exec a perl cgi program under IIS. I have only been playing around with this and I haven't had a lot of time to investigate it in detail (I was just hoping somebody here might have come across it before).

        I'm going to play around a bit more and see if I can come up with something.

        If I find a solution, I'll post something here ;-)

        Jim.