RE: [INTERNALS-WIN] RE: php-fpm for Windows?

[email protected] (jorge hernandez) Wed, 21 Dec 2022 14:38:16 -0500
Newsgroups php.internals.win
Message-ID <[email protected]>
I agree, that's why I'm using FCGID.

Thanks anyway.


-----Original Message-----
From: Mario Brandt <[email protected]>
Sent: Wednesday, December 21, 2022 2:25 PM
To: jorge hernandez <[email protected]>
Cc: Christoph M. Becker <[email protected]>; [email protected]
Subject: Re: [INTERNALS-WIN] RE: php-fpm for Windows?

Hi,
I'm a member of ApacheHaus and ApacheLounge. Indeed there is only winnt mpm
on windows available.
mod_h2 for http/2 works with worker mpm, event mpm and winnt mpm.
As mentioned right prefork does not work with mod_h2 since it does not
support threads.

There is already a way to run php-fpm on windows- The php-cgi.exe has the
option.

-b <address:port>|<port> Bind Path for external FASTCGI Server mode

Within apache

LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_fcgi_module
modules/mod_proxy_fcgi.so

I haven't tried that in ages (PHP 7.2). So it was either

<Files ~ "\.php$">
    SetHandler "proxy:fcgi://127.0.0.1:9000#"
</Files>

or

<VirtualHost *:80>
    ServerName fpm.local.apachehaus.de
    DirectoryIndex index.php
    CustomLog "C:\nul" common
    ProxyPassMatch ^/(.*\.php(/.*)?)$
fcgi://127.0.0.1:9000/c:/Users/jblond/work/$1
    DirectoryIndex /index.php index.php

    DocumentRoot "/Users/jblond/work"

    <Directory "/Users/jblond/work">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

I don't recall how I managed to run php-cgi as a windows service.

From the stability view mod_fcgid is the much better option.

Cheers
Mario

On Wed, 21 Dec 2022 at 15:56, jorge hernandez <[email protected]> wrote:
>
> Apparently mpm_winnt is the default for Windows, so that's exactly
> what I'm using along with HTTP2 and FCGID for PHP.
>
>
> -----Original Message-----
> From: Christoph M. Becker <[email protected]>
> Sent: Wednesday, December 21, 2022 8:51 AM
> To: jorge hernandez <[email protected]>; [email protected]
> Subject: Re: php-fpm for Windows?
>
> On 20.12.2022 at 23:02, jorge hernandez wrote:
>
> > Since HTTP2 sites that use PHP had to move from mod_php to php-fpm,
> > which left Windows running PHP as FCGID,
>
> Is that really the case?  While it looks like that mpm_prefork_module
> is not compatible with mod_http2 (yet?), I couldn't find information
> about mpm_winnt and mod_http2.
>
> > well some extensions like
> > uploadprogress don't work in FCGID, but as FPM, so can a php-fpm be
> > created for Windows too?
>
> A fast *process* manager would not make much sense on Windows;
> contrary to POSIX systems, there is no fork(2) on Windows, so the
> process manager would need to spawn worker processes, which would
> likely have the same issues than the currently available FCGI SAPI
> (most notably, the need to *re*-attach to OPcache SHM).  It might make
> sense to create a fast
> *thread* manager SAPI for Windows, but that would have obvious
> drawbacks (most notably, stability and security concerns) =E2=80=93 and o=
f
> course, someone would need to actually implement it.
>
> --
> Christoph M. Becker
>
> --
> Windows Internals Mailing List (http://www.php.net/) To unsubscribe,
> visit: http://www.php.net/unsub.php
>