You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@httpd.apache.org by Apache Wiki <wi...@apache.org> on 2014/07/30 21:46:11 UTC

[Httpd Wiki] Update of "PHP-FPM" by thumbs

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change notification.

The "PHP-FPM" page has been changed by thumbs:
https://wiki.apache.org/httpd/PHP-FPM?action=diff&rev1=4&rev2=5

Comment:
Added notes for DirectoryIndex to handle requests for / to a php-fpm backend

  Edit the configuration for a vhost of your choice, and add the following line to it:
  
   `ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/path/to/your/documentroot/$1`
+  `DirectoryIndex /index.php`
  
  Look confusing ? Let's run through it:
  
@@ -97, +98 @@

   /path/to/your/documentroot/:: IMPORTANT! This must ''exactly'' match the '''real''' filesystem location of your php files, because that is where the php-fpm daemon will look for them.<<BR>>
   php-fpm just interprets the php files passed to it; it is not a web server, nor does it understand your web servers' namespace, virtualhost layout, or aliases.<<BR>>
   IMPORTANT! __Read the above again__
-  $1:: expands to the entire request-URI from the original request, minus the leading slash (because we already added that above.)
+  $1:: expands to the entire request-URI from the original request, minus the leading slash (because we already added that above.)<<BR>>
+  DirectoryIndex /index.php:: a request for / will need to be mapped to a resource on the fcgi backend. Failure to address this may cause a blank response, commonly known as a WSOD (White Screen of Death), especially if only a request URI containing the php extension is proxied, such as this example. The processing chain will first map a request for / to /index.php, then proxy to the PHP-FPM backend correctly.
  
  === unix domain socket (UDS) approach ===
  

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org