[fpc-pascal] FastCGI on Windows IIS

Marcos Douglas md at delfire.net
Mon Apr 25 04:08:51 CEST 2016


On Sun, Apr 24, 2016 at 6:21 PM, Michael Van Canneyt
<michael at freepascal.org> wrote:
>
>
> On Sun, 24 Apr 2016, Marcos Douglas wrote:
>
>>> http://localhost:2015/fcgitest.exe/pdf/act1
>>>
>>> ...but it does not solve the problem. :(
>>
>>
>> My env: Lazarus 1.5 r50201M FPC 2.6.5 i386-win32-win32/win64
>>
>> So I took his example here \packages\fcl-web\examples\helloworld
>> Compiled it. ISS configured to port 2020.
>> Call in browser http://localhost:2020/helloworld.exe/func1call
>
>
> I have never tested the Fastcgi support with IIS.
> The problem is probably that IIS does not provide the same PATHINFO
> environment variable as Apache or NGINX.
>
> The PATHINFO environment variable is used to determine what module needs to
> be invoked. You can influence this by setting and handling the OnGetModule
> event of the TFastCGIApplication application object. In this event, you can
> examine the request, and return the class of the module that must be
> created.
>
> When you do, please save the contents of PATHINFO to some file, and send it
> here, so I can examine it and adapt the implementation so it can handle IIS
> as well.

Hi,

Doesn't matter if is CGI or FastCGI. Same problem.

I did more tests.
In my example, I have 1 Module "pdf" and 1 Action "act1".

The Module has a DataModuleRequest event:
begin
  AResponse.Content := 'default';
  Handled := True;
end;

The Action has a Request event:
begin
  AResponse.Content := 'list';
  Handled := True;
end;

#1 Call Action
URL: http://localhost:2015/fcgitest.exe/act1/
Result: error - Could not determine HTTP module for request "act1"
Log:
PATHINFO=/fcgitest.exe/act1/
NEXT_PATHINFO=fcgitest.exe

#2 Call Module/Action
URL: http://localhost:2015/fcgitest.exe/pdf/act1/
Result: print - "default"
Log:
PATHINFO=/fcgitest.exe/pdf/act1/
NEXT_PATHINFO=fcgitest.exe

If you do not have time, maybe I can try to fix. But how we
can know what Server is running (Apache, IIS, etc)?

Thanks,
Marcos Douglas



More information about the fpc-pascal mailing list