• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Nginx 502 Bad gateway on Php 7.2 with SSL

Kyobul

New Pleskian
If I set a web hosting for a domain to PHP 7.2 handled by Nginx with SSL enabled I'm always getting a 502 Bad Gateway when accessing the website.

If I switch to lower version of PHP - 7.1 - everything is fine with no single other change.

Error log is recv() failed (104: Connection reset by peer) while reading response header from upstream

Plesk Onyx is latest, did plesk repair instlallation, digged the Internet about 2 hours and since I'm not a sysadmin, I have no clue.

Any ideas ?
 
Is the service "plesk-php72-fpm" running? Can you start it with
# service plesk.php72-fpm restart
?
 
Thank you for your reply. Yes, indeed, the plesk-php72-fpm service is not running and there is no way it can be started.

I have uninstalled and re-installed the PHP 7.2 with the plesk installer. Nothing changes that.

Error message on # service plesk.php72-fpm restart is :

Redirecting to /bin/systemctl restart plesk.php72-fpm.service
Failed to restart plesk.php72-fpm.service: Unit not found
 
Thank you. Here is what I get :

# service plesk-php72-fpm restart
Redirecting to /bin/systemctl restart plesk-php72-fpm.service
Job for plesk-php72-fpm.service failed because the control process exited with error code. See "systemctl status plesk-php72-fpm.service" and "journalctl -xe" for details.


# /bin/systemctl status plesk-php72-fpm.service -l
● plesk-php72-fpm.service - The PHP 7.2.2 FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/plesk-php72-fpm.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2018-02-22 23:50:21 CET; 1min 55s ago
Process: 23263 ExecStart=/opt/plesk/php/7.2/sbin/php-fpm --nodaemonize (code=exited, status=78)
Main PID: 23263 (code=exited, status=78)

Feb 22 23:50:21 s20801255 systemd[1]: Starting The PHP 7.2.2 FastCGI Process Manager...
Feb 22 23:50:21 s20801255 php-fpm[23263]: [22-Feb-2018 23:50:21] WARNING: Nothing matches the include pattern '/opt/plesk/php/7.2/etc/php-fpm.d/*.conf' from /opt/plesk/php/7.2/etc/php-fpm.conf at line 119.
Feb 22 23:50:21 s20801255 php-fpm[23263]: [22-Feb-2018 23:50:21] ERROR: No pool defined. at least one pool section must be specified in config file
Feb 22 23:50:21 s20801255 php-fpm[23263]: [22-Feb-2018 23:50:21] ERROR: failed to post process the configuration
Feb 22 23:50:21 s20801255 php-fpm[23263]: [22-Feb-2018 23:50:21] ERROR: FPM initialization failed
Feb 22 23:50:21 s20801255 systemd[1]: plesk-php72-fpm.service: main process exited, code=exited, status=78/n/a
Feb 22 23:50:21 s20801255 systemd[1]: Failed to start The PHP 7.2.2 FastCGI Process Manager.
Feb 22 23:50:21 s20801255 systemd[1]: Unit plesk-php72-fpm.service entered failed state.
Feb 22 23:50:21 s20801255 systemd[1]: plesk-php72-fpm.service failed.
 
Normally in this situation the service does not start, because none of the websites is configured to use PHP 7.2 FPM. You can try to do this: Toggle the PHP setting between PHP 5.6 and PHP 7.2, then try to start the service again:
# service plesk-php72-fpm start
It should then start, because toggeling the configuration will create the missing configuration files for the PHP 7.2 FPM service.
 
Thank you for your reply. Indeed, no site was running since I wasn't able to get it running on PHP 7.2. Switching it back to PHP 7.2 (which creates config files and makes PHP.7.2-FPM running) helps nothing. So, to be sure I a proprer / new website installation : creating brand new subscrption and installing basic wordpress on it, no SSL on it.

When configured to PHP 7.2 with Nginx - always shows 502 Bad Gateway Nginx, log tells :
recv() failed (104: Connection reset by peer) while reading response header from upstream

When it is switched to PHP 7.1 with Nginx - eveything works just nice.

I suppose I'll be just sticking with PHP 7.1....
 
Switching it back to PHP 7.2 (which creates config files and makes PHP.7.2-FPM running) helps nothing.

If the config files exist as you are saying, how can the startup routine still display
"ERROR: No pool defined. at least one pool section must be specified in config file"
as you are saying, too?

Do the config files really exist?
 
The error "ERROR: No pool defined. at least one pool section must be specified in config file" was logged when I was indeed not having a single site running on PHP 7.2
It is not relevant to my last message.
 
Back
Top