Citeren Bjoern Voigt <bjoernv@arcor.de>:
Arjen de Korte wrote:
I think the 'modern' way of running PHP-FPM is through mod_proxy_fcgi. At least that is what I do here;
<IfModule mod_proxy_fcgi.c> <FilesMatch "\.php$"> # Note: The part that matters is /var/run/php-fpm/www.sock SetHandler "proxy:unix:/var/run/php-fpm/www.sock|fcgi://localhost" </FilesMatch>
# Add index.php to the list of index pages. DirectoryIndex index.php </IfModule>
My PHP-FPM Apache configuration looks like this:
/etc/apache/conf.d/php7-fpm.conf: ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/srv/www/htdocs/$1 <Proxy "fcgi://localhost:9000/" enablereuse=on max=10> </Proxy> <FilesMatch \.php$> <If "-f %{REQUEST_FILENAME}"> SetHandler "proxy:fcgi://127.0.0.1:9000" </If> </FilesMatch> SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
You have PHP-FPM configured to listen on '127.0.0.1', but in the above configuration you also use 'localhost' in your proxy configuration. In a dual-stacked system these are not equivalent. If you need processes to communicate with each other you'll have to make a choice for one or the other. So either use '127.0.0.1' or 'localhost' (or [::] for that matter) everywhere. Or better yet, configure processes to communicate over a domain socket, which is not prone to this and is actually a bit more efficient.
Apache's error_log shows such errors: [Sat Jan 05 00:40:32.267686 2019] [proxy:warn] [pid 22833] [client ::1:58160] AH00917: connect to remote machine 127.0.0.1 blocked: IP 127.0.0.1 matched [Sat Jan 05 00:40:32.267713 2019] [proxy:error] [pid 22833] [client ::1:58160] AH00898: Connect to remote machine blocked returned by /phpinfo.php
I found with Wireshark, that Apache does not even try to communicate with php-fpm over port 9000.
FPM-FPM runs on port 9000:
# netstat -tulpen|grep 9000 tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 0 322196 18092/php-fpm: mast
Greetings, Björn
-- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org