Symptoms
The apache_php_fpm service fails to start, with an error similar to:
CONFIG_TEXT: [12-Aug-2022 09:47:51] ERROR: FPM initialization failed
[12-Aug-2022 09:49:59] ERROR: [pool domain_tld] the chdir path '/home/username' does not exist or is not a directory
Cause
The apache_php_fpm service will fail to start if an account was removed from the server, but its PHP-FPM configuration file(s) was left behind, or if an existing cPanel user's configured home directory is missing.
Resolution
- Log in to the server via SSH or WHM's Terminal as the
rootuser Try to start the Apache PHP-FPM service to see what errors are experienced:
# /scripts/restartsrv_apache-php_fpm --start
Note: You will want to note the missing home directory, PHP version(s) that PHP-FPM is unable to start for, and the domain(s) in the errors.
See if the cPanel user that's missing its home directory exists on the server:
# /scripts/whoowns username
Note: You need to replace
usernamewith the cPanel username.
For example, in the error:
[12-Aug-2022 09:49:59] ERROR: [pool domain_tld] the chdir path '/home/cptest' does not exist or is not a directory
The cPanel username iscptest.- Follow the instructions in one of the provided tabs, depending on whether the cPanel user exists on the server or not.
Move aside the problematic PHP-FPM cruft:
# mv -v /opt/cpanel/ea-php##/root/etc/php-fpm.d/domain.tld.conf{,.backup.$(date +%F_%R)}
Note: You need to replace ea-php## with the ea-php or alt-php version that is failing to start and domain.tld.conf with the domain. This may need to be done for multiple domains.
Create the missing home directory:
# mkdir -v /home/username; chown username.username /home/username; chmod 0711 /home/username
Note: You need to replace all instances of username in the above-provided command with the cPanel username.
- Start the Apache PHP-FPM service:
# /scripts/restartsrv_apache_php_fpm --start
Comments
0 comments
Article is closed for comments.