Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

The most important setting in each pool is the TCP socket (IP and port) or unix domain socket (UDS) php-fpm will be listening on to receive fastCGI requests; this is configured using the listen option.


Wiki Markup
The default pool, {{\[www\]}}, has this configured as {{listen 127.0.0.1:9000}}: it will only respond to requests on the local loopback network interface (localhost), on TCP port 9000.


Also of interest are the per-pool user and group options, which allow you to run that specific fpm pool under the given uid and gid; goodbye suphp!

...

Let's just use the defaults as shipped and start the php-fpm daemon; if your distro uses the provided init script, run
/etc/init.d/php-fpm start
Or if not, start it manually with
php-fpm -y /path/to/php-fpm.conf -c /path/to/custom/php.ini
If you don't provide php-fpm with its own php.ini file, the global php.ini will be used. Remember this when you want to include more or less extensions than the CLI or CGI binaries use, or need to alter some other values there.


Wiki Markup
You can include per-pool {{php.ini}} values in the same way you would define these in apache previously for mod_php, using {{php_\[admin_\](flag|value)}}.


See the official PHP documentation for fpm for all possible configuration options.

...

LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so


Wiki Markup
Now, there are different ways to actually forward requests for .php files _to_ this module, ranging from everything (using [ProxyPass]) to very specific or rewritten files or patterns (using mod_rewrite with the \[P\] flag).


The method I chose (using ProxyPassMatch) lies somewhere in between these in complexity and flexibility, since it allows you to set one rule for all PHP content of a specific vhost, but will only proxy .php files (or URLs that contain the text .php somewhere in the request).

...