2.7.3. PHP-FPM


PHP-FPM is only available on businesshosting.

PHP—FPM (FastCGI Process Manager) is an alternative implementation of FastCGI mode in PHP. In conjunction with nginx, it provides a higher request processing speed than the default nginx + Apache bundle.

  • Can be used PHP version not lower than 7.0.
  • Rules in .htaccess do not apply.
  • PHP-FPM processes are constantly running and consume memory, which is counted in the hosting account quota. With a large number of concurrent requests, a large amount of RAM may be required.
  • PHP only processes files with the extension .php.
  • The standard index file is index.php... For comparison: on request to /html/ Apache will return the contents of the file /html/index.htmlif it exists, and PHP-FPM in such a situation will return a 403 error if the directory /html/ exists, or will send a request to /index.phpif directory /html/ does not exist. When choosing configuration PHP-FPM «Dokuwiki» the standard index file will be doku.php.
  • Routes are configured as follows:
    • If the call goes to a specific file with the extension .php — this file is launched (for example, a request to /path/test.php runs the file /path/test.phpif no such file exists — an error is returned «File not found»).
    • If the call goes to the URL of an existing directory, it starts index.php from that directory (for example, a request to /wp-admin/ runs the file /wp-admin/index.phpif file index.php not in directory — error 403 is returned).
    • All other requests are redirected to /index.php (the requested URL will be available in $_SERVER['REQUEST_URI']).

After changing the web server to PHP-FPM, it becomes possible to select one of the available configuration options:

  • «Default» — file requests *.php are sent directly to FPM (there will be a 404 error if the file is missing), other requests are redirected to /index.php. Suitable for CMS that do not require specific settings, for example Joomla! or Octoberas well as frameworks Symfony and Laravel.
  • «Wordpress» — currently the same as «Default»... Perhaps, special settings will be added in the future.
  • «Opencart» — CNC support in format OpenCart. Works similar to the default, only requests are redirected to /index.php?route=.
  • «Dokuwiki» — index file doku.php insteadof index.php, support for CNC format DokuWiki, blocking access to directories /conf/, /bin/, /inc/ and file /install.php.
  • «ModX» — CNC support in format MODX.
  • «Moodle» — URL view support /index.php/path for Moodle.
  • «PrestaShop» — Support for CNC format PrestaShop.
  1. Check out peculiarities of work PHP-FPM and make sure your site respects them.
  2. Openup site settings.
  3. For parameter «Web server » set the switch opposite «PHP-FPM», against «PHP-FPM configuration» select the one you want configuration and at the bottom of the page click «Save»:
  4. Wait approximately 10-15 minutes for the changes to take effect.