Skip to content

Commit 9b021b2

Browse files
author
Till Brehm
committed
Added support for php-fpm with mod_proxy_fcgi (required for apache 2.4).
Note: The mod_proxy_fcgi that ships with CentOS and Ubuntu does not support sockets yet, so all php-fpm connections are done by IP.
1 parent 6061d5f commit 9b021b2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

server/conf/vhost.conf.master

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@
334334
FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -socket <tmpl_var name='fpm_socket'> -pass-header Authorization
335335
</tmpl_if>
336336
</IfModule>
337+
<IfModule mod_proxy_fcgi.c>
338+
ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ fcgi://127.0.0.1:<tmpl_var name='fpm_port'><tmpl_var name='web_document_root'>/$1
339+
</IfModule>
337340
</tmpl_if>
338341

339342
<tmpl_if name="rewrite_enabled">

server/plugins-available/apache2_plugin.inc.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,8 +1262,9 @@ function update($event_name, $data) {
12621262
$pool_name = 'web'.$data['new']['domain_id'];
12631263
$socket_dir = escapeshellcmd($web_config['php_fpm_socket_dir']);
12641264
if(substr($socket_dir, -1) != '/') $socket_dir .= '/';
1265-
1266-
if($data['new']['php_fpm_use_socket'] == 'y'){
1265+
1266+
// User sockets, but not with apache 2.4 as socket support is buggy in that version
1267+
if($data['new']['php_fpm_use_socket'] == 'y' && $app->system->getapacheversion() < 2.4){
12671268
$use_tcp = 0;
12681269
$use_socket = 1;
12691270
} else {

0 commit comments

Comments
 (0)