Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Perl Win32 Apache & mod_fcgid not working

by roey (Initiate)
on Jan 30, 2011 at 11:20 UTC ( [id://885115]=perlquestion: print w/replies, xml ) Need Help??

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

I have installed apache 2.2.15 with mod_fcgid on Windows XP SP3 and Activestate Perl (tried both 5.12 & 5.8.9) tried the perl example script in the mod_fcgid reference page but it is not working, however it does run as simple cgi I get this in error log
[Tue Dec 07 23:10:35 2010] [info] mod_fcgid: server 127.0.0.1:/usr/bin +/perl.exe(5476) started [Tue Dec 07 23:10:35 2010] [warn] [client 127.0.0.1] (OS 109)The pipe +has been ended. : mod_fcgid : get overlap result error [Tue Dec 07 23:10:35 2010] [error] [client 127.0.0.1] Premature end of + script headers: f.pl [Tue Dec 07 23:10:35 2010] [error] [client 127.0.0.1] File does not ex +ist: C:/Apache2/htdocs/favicon.ico [Tue Dec 07 23:10:39 2010] [info] mod_fcgid - infoneto: process /usr/b +in/perl.exe(5476) exit(communication error), return code 9
I double check everything including: The #!/usr/bin/perl.exe line The mod_fcgid is loaded (Yes it is on c:\usr\bin\perl.exe in may case...) When running the script as plain cgi it works When I turned to the older mod_fastcgi it works just fine as a fastcgi (i.e. loads once runs many times). Using process monitor I can see that apache starts Perl but it Perl exits almost instantly without even loading the Perl script I tried it also on Apache 2.0.52 & 2.0.63 with older mod_fcgid and with Apache 2.2.15 with the newest mod_fcgid (2.3.6) but no luck What can be done ? I googled around but no one seems to have solution or managed using mod_fcgid with perl on Win32 I opened a bug on both FCGI at cpan and on apache tracker but no one seems to care... Is there a solution for this ? Does someone else need this ? (mod_fcgid with Perl on Apache/Win32) This is the code I am trying:
#!/usr/bin/perl.exe use FCGI; my $count = 0; my $request = FCGI::Request(); while($request->Accept() >= 0) { print("Content-type: text/html\r\n\r\n", ++$count); }

Replies are listed 'Best First'.
Re: Perl Win32 Apache & mod_fcgid not working
by Corion (Patriarch) on Jan 30, 2011 at 11:29 UTC

    It seems you reported that bug half a year ago via RT. I would guess that there is some kind of bug you encounter. Have you tried launching your (FCGI) script stand-alone from the console and seeing whether that produces an error? Also try redirecting STDERR to a file to see whether Perl creates an error. Maybe add sleep calls to delay the premature exit, just to convince yourself that Apache launches Perl and that Perl enters the ->Accept loop.

      * Have you tried launching your (FCGI) script stand-alone from the console and seeing whether that produces an error?
      --- Yes - it works and it works a regular cgi as well

      * try redirecting STDERR to a file to see whether Perl creates an error
      --- Tried it - the script is not even started to run

      * Maybe add sleep calls to delay the premature exit, just to convince yourself that Apache launches Perl and that Perl enters the ->Accept loop.
      --- Well apache launches perl - but perl just closes and it is not loading the script

      The main point Perl stats and exits due to some communication error with mod_fcgid.
Re: Perl Win32 Apache & mod_fcgid not working
by Anonymous Monk on Jan 30, 2011 at 20:06 UTC

      Do not use mod_fcgid with perl on MS Windows as it simply does not work.

      OK - why odes it not work ? what is broken ? currently mod_fcgid is the official way to use fastcgi on apache and mod_fastcgi is old ...

      anyway thanks for the link, I will check it - I had many problems with mod_fastcgi

        The article linked doesn't explain why
        For running Catalyst application as FastCGI on Apache/Win32 you have to choose mod_fastcgi (the author of this article did not manage after many tries to run catalyst app via mod_fcgid).

         

        If you're quoting someone, use

        <blockquote> the quote </blockquote> your response
        or
        <i> the quote </i> <p>your response
        <dl<dt> the quote </dt> <dd> your response </dd></dl>

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://885115]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-24 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found