httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexandru Duzsardi" <>
Subject RE: [users@httpd] How does this configuration work?
Date Thu, 03 Nov 2016 19:14:38 GMT
Usually /var/run and /run are symlinks one of the other 

so that makes /var/rum/php7.0-fpm.sock and /run/php7.0-fpm.sock the same unix domain socket


From: Jason Brooks [] 
Sent: Thursday, November 3, 2016 9:07 PM
Subject: [users@httpd] How does this configuration work?




So, the need to make sense of this is not an issue: I will be using the mod_proxy_fcgi to
use php-fpm.  I am just curious.


While trying various configurations to get php-fpm to work, I found the following conundrum:
the following configuration should NOT work but it does...


Here is the apache configuration snippet derived from this site <>
 dated last August.

            <Directory /usr/lib/cgi-bin> 

                        Require all granted 


             <IfModule mod_fastcgi.c> 

                        AddHandler php7-fcgi .php 

                        Action php7-fcgi /php7-fcgi virtual 

                        Alias /php7-fcgi /usr/lib/cgi-bin/php7-fcgi 

                FastCgiExternalServer /usr/lib/cgi-bin/php7-fcgi -socket /var/run/php/php7.0-fpm.sock
-pass-header Authorization



Here is the php-fpm www pool socket definition as configured out-of-the-box:

            listen = /run/php/php7.0-fpm.sock


My test php script calls phpinfo() only.  It works.  It’s not clear how it works.  

            Apache opens /var/run/php/php7.0-fpm.sock

            php-fpm opens /run/php/php7.0-fpm.sock

            removal of either file causes php not to work.

            When I point apache to the socket file php-fpm opens, it does not work.


HOW?  How does apache manage to connect to php-fpm when the defined socket paths do not make
sense?  As far as I know, the unix socket file is simply opened and read/written to: there’s
no way to tell linux “connect both files to each other” from within a program...


Thanks for your time!



Jason Brooks

Systems Administrator


Performance is Art.




505 nw couch #300












View raw message