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

Leonardo M. Ramé martinrame at yahoo.com
Wed Apr 4 13:52:01 CEST 2012

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.

Leonardo M. Ramé

> 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?
>* 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.
>fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org

More information about the fpc-pascal mailing list