1

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

ProxyPassMatch "^/(.*\.php(/.*)?)$" "fcgi://127.0.0.1:9000/$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://127.0.0.1:9000/var/www/"
     DirectoryIndex index.html index.htm index.shtml welcome.html index.php /index.php
     Options +Indexes +Multiviews +Includes +FollowSymLinks
</FilesMatch>

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

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

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.

0

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://127.0.0.1:9000/var/www/"
    </FilesMatch>
</Directory>

Note: Indexes will show a directory listing.

1
  • 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. – Raziel Ravenheart Jul 31 '17 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.