httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Brooks <>
Subject [users@httpd] Question about configuring apache to use php via fpm
Date Thu, 03 Nov 2016 18:05:00 GMT

There are several sites on configuring apache with php-fpm.  Many don’t work, some appear
to be contradictory.  

Thus far, I found two configurations that work, but I am not sure which one is more correct.
 By “more correct” I mean 

less convoluted
less hidden issues
less security problems
better performing

This is on a ubuntu 16.04 LTS server, running apache 2.4.18, mpm-event, with php7.0-fpm installed.
 I do NOT have mod_php installed.  For my test, I am just running the phpinfo() function call.

Here are the configuration methods I have found to work:
1) using mod_alias, mod_fastcgi, and mod_actions:
	<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 -host -pass-header Authorization


This was found at
<> dated last
	it seems hacky: it needs a cgi-bin directory to be configured, but doesn’t actually put
anything in a cgi-bin directory to execute...

2) using mod_proxy, and mod_proxy_fcgi
	ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://localhost:9000/var/www/html/$1" enablereuse=on

This was found at <>
dated last July.
	it seems more elegant, but I don’t know how speedy it might be.

Thank you for your time!


Jason Brooks	Systems Administrator
eROI	Performance is Art.
m:	505 nw couch #300	w: <>
t:	503.290.3105	f:	503.228.4249

fb: <>

View raw message