[fpc-pascal] CGI under Linux using FCL-Web

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Wed Apr 4 13:56:16 CEST 2012



On Wed, 4 Apr 2012, Leonardo M. Ramé wrote:

> Another tip for linux/unix. Try to run the CGI program from the command line, it should output something similar to this:
>
> Exception at 0000000000497B3A: Exception:
> No REQUEST_METHOD passed from server.
>
> Otherwise there's an error in your code.

Better yet, you can test CGI programs with the testcgiapp program that is
located in the fcl-web sources. developed specially to test such things.

Michael.
>
> Leonardo M. Ramé
> http://leonardorame.blogspot.com
>
>
>> ________________________________
>> From: "michael.vancanneyt at wisa.be" <michael.vancanneyt at wisa.be>
>> To: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org> 
>> Sent: Wednesday, April 4, 2012 8:42 AM
>> Subject: Re: [fpc-pascal] CGI under Linux using FCL-Web
>> 
>>
>>
>> On Wed, 4 Apr 2012, Christian Kranich wrote:
>>
>>> Hello All,
>>>
>>> I just started to use FPC in  a project requiring a Webinterface.
>>> When porting the Lazarus/Win32 fpc-web examples (worked fine)
>>> to X86/Linux(Ubuntu) and Arm-Linux, I started to struggle.
>>>
>>> Under Linux, the cgi program terminates w/o any output and w/o any
>>> errormessages. So Apache complains about premature page end.
>>>
>>> => Is there anything special to consider when using fcl-web under
>>> Linux?
>>
>> Yes.
>>
>> * Do not use the crt, video or keyboard units.
>> * Do not attempt I/O to standard input/output/error.
>>
>>> => The bread and butter cgi example (mini.pas) did run, but I like the
>>> concept of FCL-Web offering scalability between CGI, FastCGI, Apache Module
>>> and do not want to reinvent the wheel...
>>>
>>> Currently I started copying the fcl-web sources to project folder and pinpointing
>>> with writelns to crosscheck what is running and what is not.
>>
>> Check the error log of apache. 
>> It will contain the error output of the CGI script.
>>
>> Michael.
>> _______________________________________________
>> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>
>>
>>  
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>


More information about the fpc-pascal mailing list