Recently I compiled php 5.3.11 with fpm support, and as soon I get apache up using

ProxyPassMatch "^/(.*\.php(/.*)?)$" "fcgi://$1"
DirectoryIndex index.html index.htm index.sthml welcome.html /index.php index.php

It makes php to work fine, but stops directory listing; on the other hand I have:

<FilesMatch ".*\.php.*">
     SetHandler "proxy:fcgi://"
     DirectoryIndex index.html index.htm index.shtml welcome.html index.php /index.php
     Options +Indexes +Multiviews +Includes +FollowSymLinks

And it works backwards as ProxyPassMatch, everything works but php breaks.

I have my php-fpm.conf directive: listen =

I tried

listen = /var/run/php-fpm.sock

But it happens all the same.

Is that it isn't possible to use Options +Indexes +Multiviews +Includes +FollowSymLinks altogether with ProxyPassMatch?

Why isn't my FilesMatch directive working? I even have tried to setHandler the full path

And believe me, I have tried almost everything I have found using google, server fault and stack overflow!!!

Thanks for your help.

1 Answer 1


Options related to Indexes and the likes make no sense inside Files/FilesMatch, it is intended for "directories".

You should try something like:

<Directory /path/to/documentroot>
    DirectoryIndex index.html index.htm index.shtml welcome.html index.php
     Options +Indexes +Multiviews +Includes +FollowSymLinks
    <FilesMatch \.php>
        SetHandler "proxy:fcgi://"

Note: Indexes will show a directory listing.

  • It seems my error is the chroot configuration for php-fpm, that was set to '/var/www'. I changed it to "/" and worked, but right now I am still trying to figure out how it works with apache and how to configure it to have a safe server. It is not very important since I am working on a development/test local machine, but I will keep reading. Right now I believe that somehow chroot php-fpm's conf depends on DocumentRoot apache httpd's configuration. Anyway, thanks for your help, it helped me to go on the right direction. Jul 31, 2017 at 16:17

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.