1

I'm setting up Apache with proxy_fcgid to pass the php-requests to a dedicated php-fpm instance on a remote machine.

Configuration on the Apache-Box:

<FilesMatch \.php$>
#  SetHandler "proxy:unix:/var/run/php56-fpm/php-fpm.sock|fcgi://localhost"
SetHandler "proxy:fcgi://xyz:9005#"
</FilesMatch>
<Proxy fcgi://localhost>
ProxyFCGISetEnvIf "true" PATH_INFO "%{reqenv:SCRIPT_NAME}"
ProxySet connectiontimeout=5 timeout=240
</Proxy>
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-f
RewriteRule (.*) - [H=text/html]

php-fpm.conf's settings are basically left to default, yet all requests 404 on the machine running php-fpm and

ProxyPass fcgi://127.0.0.1:9000/var/www/default/wwwroot/$1

also requires the full path on the local filesystem, leaving me clueless on how to run the scripts residing on the Apache-Box.

  • what is "proxy:fcgi://xyz:9005#" with # at the end? – ezra-s Mar 19 '18 at 8:14
  • 2
    If this is still of interest: You do not send the code over to the FPM machine, so you have to deploy the code there to. It has to be in the same directory as it is on the host. – Daniel Jun 23 '18 at 22:54

Your Answer

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

Browse other questions tagged or ask your own question.