Topic: [INFO] CentOS 7.1, httpd, php-fpm and the right handling of scripts

Hello,

With the upcomming release of CentOS 7.1, i have tested the httpd-2.4.6-31.el7.x64_86.rpm package (currently in CentOS-CR repo) with the added support for SetHandler (Redhat bug report at bugzilla.redhat.com/show_bug.cgi?id=1136290 )

I was wondering if only the SetHandler directive has been backported, or if they also backported the possibility to use unix sockets.

So i tested the following in a virtualhost:

<IfModule event.c>
                <FilesMatch \.php$>
                        SetHandler "proxy:unix:/var/run/php-fpm.default_vhost.socket|fcgi://localhost/"
                </FilesMatch>
</IfModule>

And it works great ! Sockets declared by php-fpm listen directive work too !
This should also get rid of the hideous "AH01071: Got error 'Primary script unknown'" error which gets triggered way to easy with the ProxyPassMatch directive.

PS: i use the <IfModule event.c> directive in my virtualhosts because i left the mod_php php.conf file with <IfModule prefork.c> directive so i can easily switch between both implementations by changing the MPM and make some speed tests without having to reconfigure every vhost.

Re: [INFO] CentOS 7.1, httpd, php-fpm and the right handling of scripts

Yes, this is explained on http://blog.famillecollet.com/post/2014 … ment#c5610

But thanks for the feedback.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: [INFO] CentOS 7.1, httpd, php-fpm and the right handling of scripts

> PS: i use the <IfModule event.c> directive in my virtualhosts ...

Perhaps <IfModule !mod_php5.c> is better wink

See http://pkgs.fedoraproject.org/cgit/php. … e/php.conf
(this is the one in Fedora repository, where php-fpm + UDS is now supported out-ot-the-box)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: [INFO] CentOS 7.1, httpd, php-fpm and the right handling of scripts

> Perhaps <IfModule !mod_php5.c> is better
Thanks for the tip, but i try to get sure i won't mix mod_php with MPM_event because mod_php isn't thread safe, so using <IfModule event.c> seems more accurate for my setup.

I actually followed your blog for quite a while, and have used multiple times remi-php55 in the past, thanks for your work, also your work on SCL.
But as of my understandings, using SetHandler this way didn't work in httpd-2.4.6-19 for EL7, and this release only allowed usage of unix sockets for mod_proxy, am i wrong ?