• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Thoroughly confused by PHP-FPM, Nginx, etc.

pDecrette

New Pleskian
Is anyone else thoroughly confused by the configuration of PHP-FPM, Nginx, FastCGI, etc.? This is what I have been able to determine and not determine...

** NGINX **
Error log: /var/log/nginx/error.log
NGINX configuration file: /etc/nginx/nginx.conf
Domain specific NGINX: /var/www/vhosts/system/domain.tld/conf/nginx.conf

Gets overwritten; I guess you make these changes somewhere in Plesk? For now, I just use the master /etc/nginx/nginx.conf which DOES seem to work. I have lots of customizations in here, most commented.
Restart the service: through Plesk, or /bin/systemctl restart nginx.service or service nginx restart.


** PHP-FPM **
Error log = /var/log/plesk-php56-fpm/error.log
And /var/log/php-fpm/error.log
PHP-FPM configuration file: /opt/plesk/php/5.6/etc/php-fpm.conf
Gets overwritten when you make changes in Plesk.

Another PHP-FPM configuration file (that I don't think is used, but could be): /etc/php-fpm.d/www.conf

Another PHP-FPM configuration file/etc/php-fpm.conf:

Domain specific PHP-FPM: /var/www/vhosts/system/domain.tld/conf/php.ini

Note: FPM uses php.ini syntax for its configuration file.
Make changes in /var/www/vhosts/system/domain.tld/conf/php.ini, then run this:
/usr/local/psa/bin/php_settings -u
It will add your custom settings to the bottom of /opt/plesk/php/5.6/etc/php-fpm.d/domain.tld.conf
Then restart php-fpm service: Through Plesk, or /bin/systemctl restart plesk-php56-fpm.service or service plesk-php56-fpm restart (/bin/systemctl restart php-fpm.service or service php-fpm restart are for the base PHP's fpm service which we do not use.)

** PHP **
Error log = /var/www/vhosts/system/domain.tld/logs/error_log
and /var/www/vhosts/system/domain.tld/logs/proxy_error_log
PHP configuration file (for PHP 5.6): /opt/plesk/php/5.6/etc/php.ini
Domain specific PHP file: /var/www/vhosts/system/domain.tld/etc/php.ini
Using the PHP Additional Directives in Plesk, plesk overwrite this file.
Don't change this file manually, but you can check things there after making changes. Plesk also writes some values to the bottom of /opt/plesk/php/5.6/etc/php-fpm.d/domain.tld.conf
Restart the service: through Plesk, or /bin/systemctl restart httpd.service or service httpd restart


** FastCGI **
Error log = /var/www/vhosts/system/domain.tld/logs/proxy_error_log
Config file 1: /etc/httpd/conf.d/fcgid.conf
Another: /etc/psa/php_versions.d/plesk-php56-fastcgi.conf
Another: /etc/nginx/fastcgi.conf
(There are more. I really don't know how these are edited or work.)

Is there any comprehensive documentation on any of these configuration files, when they are used, how to modify them, and so on? 4 different configuration files for JUST php-fpm seems... um, confusing. We are trying to track down the cause of "connect() failed (111: Connection refused) while connecting to upstream..." errors.

If anyone can shed light on any of this for me, it would be greatly appreciated.
 
Hi pDecrette,

you might be interested in:

Customizing PHP Configuration ( Plesk 12.5 online documentation )

and it's schemata:
69697.gif
As you can see, there is a hierarchy, which follows the order "last command = final configuration".


Gets overwritten; I guess you make these changes somewhere in Plesk? For now, I just use the master /etc/nginx/nginx.conf which DOES seem to work. I have lots of customizations in here, most commented.
Again, there is a hirarchy for webserver - configuration files:

 
Back
Top