• 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 PHP 7.1 Nginx-FPM leads to strange web server configuration failure on Onyx 17.0

Bitpalast

Plesk addicted!
Plesk Guru
Onyx 17.0, CentOS 7.4

PHP 7.1 as Nginx-FPM leads to a strange web server configuration file issue:

Code:
Unable to generate the web server configuration file on the host <hostname> because of the following errors:

Template_Exception: nginx: [emerg] unexpected ";" in /etc/nginx/plesk.conf.d/vhosts/<domainname>.conf:84
nginx: configuration file /etc/nginx/nginx.conf test failed

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
Please resolve the errors in web server configuration templates and generate the file again.

The nginx configuration file in this case does not have a line no. 84, but is empty but a few lines (the introduction) and a comment "Domain is disabled".

When selecting PHP 7.1 as Apache-FPM everything works well.

Not tested on Onyx 17.5.
 
Peter, I can't reproduce it on fresh 17.0 installation. I see following config file:

[root@ppu17-0 ~]# cat /etc/nginx/plesk.conf.d/vhosts/domain.tld.conf
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.[root@ppu17-0 ~]#

Maybe

# plesk repair web

will help?
 
I have tested it on another 17.0 and one 17.5 system. Neither reproduces the error.
I have then tested it on another subdomain of the same 17.0 system where the customer subscription is causing the issue. It works and does not reproduce the error. This rules out any issue with the vhost template files, because else on the same system other domains would reproduce the same error, because all are using the same templates.

However, I have then tested it again in the customer's subscription and can reproduce the issue with a slightly different result than before: The web server configuration files are now regenerated with the Apache FPM setting (despite the Nginx FPM selection), but then the same awkward error message that in line 84 there is a syntax error is displayed. It seems that the issue is limited to one specific subdomain of the customer subscription.

"plesk repair web <domainname>" did not detect any errors when run on the domain in the "Apache FPM" setting.

When run in the "Nginx FPM" setting state that causes the error, the plesk repair tool returns:
Code:
Repairing web server configuration
    Repairing web server configuration for the domain <domainname>[2017-12-11 19:40:24] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/httpdmng' '--reconfigure-domain' '<domainname>'] with exit code [1]
[FAILED]
    - httpdmng failed: [2017-12-11 19:40:22] ERR [util_exec]
      proc_close() failed ['/usr/local/psa/admin/bin/nginx-config'
      '-t'] with exit code [1]
      [2017-12-11 19:40:24] ERR [panel] Apache config
      (15130176210.66946300) generation failed: Template_Exception:
      nginx: [emerg] unexpected ";" in
      /etc/nginx/plesk.conf.d/vhosts/<domainname>.conf:84
      nginx: configuration file /etc/nginx/nginx.conf test failed

      file:
      /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
      line: 75
      code: 0
      nginx: [emerg] unexpected ";" in
      /etc/nginx/plesk.conf.d/vhosts/<domainname>.conf:84
      nginx: configuration file /etc/nginx/nginx.conf test failed

Error messages: 0; Warnings: 0; Errors resolved: 0


exit status 1

However,
# service nginx -t
afterwards does not give any error this time (it did before), because now the nginx.conf file is being reconfigured with the Apache FPM setting.

The only difference between the subscriptions and tests where the FPM Nginx setting works and this one subdomain of the customer subscription where the error is caused is, that the customer was previously using the Git extension on this domain. It has been removed, but maybe using this extension has left some changes in database tables that are giving false instructions to the web server reconfiguration function?

To me this seems like a case for a detailed investigation by Plesk support. Unfortunately, for this machine we do not have a support contract. Maybe I will submit the case later when we have a contract for it.
 
@Peter Debik
If you can describe in detail the steps to reproduce this problem, then simply fill out the Report and I will send it to the developers for the further investigation.
 
Back
Top