I've been using successfully fcgi for php and mod_vhost_alias. Now with new server I was looking into php-fpm which looks interesting with Apache/2.4.6 on CentOS 7. php-fpm setup is working fine but together with mod_vhost_alias I"m not able to construct proper ProxyPassMatch rule.

My mod_vhost_alias setup is VirtualDocumentRoot /var/www/vhosts/%-2.0.%-1.0/%-3+/

Any ideas how to create proper match for any .php to pass to php-fpm running on fcgi://

No matter what I do I get only AH01071: Got error 'Primary script unknown\n'


Try with FilesMatch \.php$ instead of ProxyPassMatch.


  <FilesMatch \.php$>
    SetHandler "proxy:unix:/var/run/php5-fpm.sock|fcgi://localhost"

See a full example: Dynamic development area with Apache 2.4 and PHP-FPM

I hope this help.

| improve this answer | |
  • I've been banging my head against the wall on this for over a week. Note that this method requires Apache 2.4.10 or above, so it isn't useful for default Apache 2.4.6 that comes in the CentOS 7 base repositories. – David W Nov 7 '15 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy