Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plack::Handler::FCGI not working on Win32/Apache #247

Closed
Roeya opened this issue Sep 27, 2011 · 3 comments
Closed

Plack::Handler::FCGI not working on Win32/Apache #247

Roeya opened this issue Sep 27, 2011 · 3 comments

Comments

@Roeya
Copy link

Roeya commented Sep 27, 2011

the run() method of Plack::Hanlder::FCGI on Win32 / Apache2 dies in the following code:

sub run {
    my ($self, $app) = @_;

    my $sock = 0;
    if (!RUNNING_IN_HELL && -S STDIN) {
         # running from web server. Do nothing
    } elsif ($self->{listen}) {
        my $old_umask = umask;
        unless ($self->{leave_umask}) {
              umask(0);
         }
        $sock = FCGI::OpenSocket( $self->{listen}->[0], 100 )
            or die "failed to open FastCGI socket: $!";
         unless ($self->{leave_umask}) {
             umask($old_umask);
         }
   } else {
        die "STDIN is not a socket: specify a listen location";   # <=== CODE DIES HERE ==
   }
   ....

seems there is a missing case in the if to handle Win32 / Apache2 correctly.

If we remark the else case then it works , please take a look and see what should be done in case of Win32 under Apache in the above code.

The script itself is a Dancer application

@miyagawa
Copy link
Member

OK, there's definitely an issue here: it used to be

if ($self->{listen}) {
   ...
} elsif (!RUNNING_IN_HELL) {
   !-S STDIN or die ...
}

How do you run your fastcgi app on win32/apache2 btw? I'm assuming you're running it with the dynamic mode? mod_fastcgi and .fcgi script with plackup in its shebang?

@miyagawa
Copy link
Member

Hm, because you hit the else case, maybe you have a .fcgi script with the direct use of Plack::Handler::FCGI (instead of plackup)?

@miyagawa
Copy link
Member

Try this patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants