Re: [INTERNALS-WIN] RE: php-fpm for Windows?
[email protected] (Mario Brandt) Wed, 21 Dec 2022 20:25:02 +0100
| Newsgroups | php.internals.win |
|---|---|
| Message-ID | <CAA=k7mVvCoeEHFjpTDOfWc9iP+j-R7_ZVJrtdmKHFON54pi+YQ@mail.gmail.com> |
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 t=
o
> POSIX systems, there is no fork(2) on Windows, so the process manager wou=
ld
> need to spawn worker processes, which would likely have the same issues t=
han
> 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 of 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
>