php5-cgi and php-fpm processes run on one domain simultaneously

Created:

2016-11-16 12:40:54 UTC

Modified:

2017-08-16 16:56:30 UTC

0

Was this article helpful?


Have more questions?

Submit a request

php5-cgi and php-fpm processes run on one domain simultaneously

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk Onyx for Linux

Symptoms

  1. In process list we can see that same domain served by php-fpm and php5-cgi simultaneously:
    # top -c | grep domain.tld
    php-fpm: pool domain.tld
    /usr/bin/php5-cgi -c /var/www/vhosts/system/domain.tld/etc/php.ini

Cause

This behavior is caused by two things:

  1. Site is using URL rewrite functions, most CMS (WordPress, Joomla etc.) are using it.
  2. Serve static files directly by nginx option.

    Given option is implemented in ngnix via try_files directive which is checks the existence of files in the specified order and uses the first found file for request processing; the processing is performed in the current context. The path to a file is constructed from the file parameter according to the root and alias directives. If none of the files were found, an internal redirect to the apache is made.

Resolution

  • Modify URL rewrite rules to remove htm or html suffix from URL. This also can be managed via some particular CMS settings.

  • Exclude htm or html or any other extension from static files list in
    Domains > domain.tld > Web Server Settings > nginx settings > Serve static files directly by nginx

alttext

If this option is enabled requests for the listed file extensions will be handled by nginx only and never reach Apache, in case if the file is present on file system. Apache rewrite rules and .htaccess directives will not be applied.

See more information in:- Plesk Administrator's Guide
- Nginx manual

Have more questions? Submit a request
Please sign in to leave a comment.