Symptoms
-
Unable to create domain or subdomain with the following error:
PLESK_ERROR: Error: phpinimng failed: Unable to update the config file for ‘fpm’ service due to syntax errors. New configuration files for the Apache web server were not created due to the errors in configuration templates: Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = Template_Exception: No data. file: /usr/local/psa/admin/plib/Template/Processor.php line: 28 code: 0 Previous error: Template_Variable_Exception: No data. file: /usr/local/psa/admin/plib/Template/Variable/AbstractCachedData.php line: 67 code: 0.
-
Unable to create a subscription via an API call. Plesk returns the following response:
...
<result>
<status>error</status>
<errcode>2204</errcode>
<errtext>Unable to update hosting preferences. phpinimng failed: Unable to update the config file for 'fpm' service due to syntax errors.</errtext>
</result>
... -
Cannot enable hosting for the domain with ‘No hosting’ of ‘Forwarding’ type:
PLESK_ERROR: Error: phpinimng failed: configuration test ‘/opt/plesk/php/7.3/sbin/php-fpm –test’ failed with code 78, and message:
[21-Dec-2018 14:32:20] ERROR: [pool example.com] the prefix ‘/var/www/vhosts/system/example.com’ does not exist or is not a directory
[21-Dec-2018 14:32:20] ERROR: failed to post process the configuration
[21-Dec-2018 14:32:20] ERROR: FPM initialization failed -
php-fpm service fails to restart with the following error:
# systemctl restart php-fpm
● php-fpm.service – The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2017-12-01 18:45:39 +07; 9s ago
Dec 01 18:45:39 hostname php-fpm[14050]: [01-Dec-2017 18:45:39] ERROR: [pool example.com] the prefix ‘/var/www/vhosts/system/example.com’ does not exist or is not a directory
Dec 01 18:45:39 hostname php-fpm[14050]: [01-Dec-2017 18:45:39] ERROR: failed to post process the configuration
Dec 01 18:45:39 hostname php-fpm[14050]: [01-Dec-2017 18:45:39] ERROR: FPM initialization failed -
Hosting type for example.com is set to forwarding:
-
There is php-fpm pool configuration file for example.com:
# ls -l /etc/php-fpm.d/example.com.conf
-rw-r–r–. 1 root root 1367 Oct 19 17:24 /etc/php-fpm.d/example.com.confor
# ls -l /etc/php/X.X/fpm/pool.d/sub.example.com.conf
-rw-r–r–. 1 root root 1367 Oct 19 17:24 /etc/php/X.X/fpm/pool.d/sub.example.com.confwhere X.X is an appropriate PHP version
Cause
php-fpm
service fails to start as domain’s php-fpm pool configuration file was not removed after changing the hosting type to forwarding or removing the domain.
Resolution
-
Log into the server via SSH;
-
Delete PHP-FPM pool configuration file:
# rm -f /etc/php-fpm.d/example.com.conf
# rm -f /etc/php/X.X/fpm/pool.d/sub.example.com.conf
-
Start php-fpm service:
# service php-fpm start
Note: application pools of domains using PHP handlers provided by Plesk are located in /opt/plesk/php/*/etc/php-fpm.d/