In multiple selector php mode, not found php-fpm service

NabiKAZ

Verified User
Joined
Nov 4, 2014
Messages
5
I needed to use multiple php 5.6 and 7.2 at same time.

I install nginx_apache from this tuterial:
https://www.vultr.com/docs/installing-nginx-on-directadmin

And I install php5.6 and php7.2 from this tuterial:
https://www.vultr.com/docs/installing-nginx-on-directadmin

Commands in summary:
Code:
# cd /usr/local/directadmin/custombuild
# ./build set php1_mode php-fpm
# ./build set php2_mode php-fpm
# ./build set php1_release 7.2
# ./build set php2_release 5.6
# ./build php n
# ./build rewrite_confs
I don't have any problem with php7.2.
But about php5.6 get this error on the web page:
Code:
Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
More informations:

Code:
# cat /proc/version
Linux version 2.6.32-642.11.1.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) ) #1 SMP Fri Nov 18 19:25:05 UTC 2016
Code:
# cat /etc/*release
CentOS release 6.8 (Final)
Code:
# /usr/local/directadmin/directadmin version
Version: DirectAdmin v.1.53.0
Code:
# /usr/local/directadmin/custombuild/build version
2.0.0 (rev: 1848)

custombuild php options:
Code:
#PHP Settings
php1_release=7.2
php1_mode=php-fpm
php2_release=5.6
php2_mode=php-fpm

Code:
# service php-fpm72 graceful
Gracefully reloading service php-fpm72:  done
Code:
# service php-fpm56 graceful
php-fpm56: unrecognized service
Code:
# /etc/init.d/php-fpm72
Usage: /etc/init.d/php-fpm72 {start|stop|restart|force-quit|reload|graceful}
Code:
# /etc/init.d/php-fpm56
-bash: /etc/init.d/php-fpm56: No such file or directory
php error log (/var/log/httpd/domains/xxxxx.error.log):
Code:
[Fri Apr 06 00:35:41.151184 2018] [proxy:error] [pid 28695:tid 140609998190336] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /usr/local/php56/sockets/xxxxx.sock (*) failed
[Fri Apr 06 00:35:41.151226 2018] [proxy_fcgi:error] [pid 28695:tid 140609998190336] [client xxxxxxxxxx:37076] AH01079: failed to make connection to backend: httpd-UDS
Code:
# grep 'listen' /usr/local/php72/etc/php-fpm.conf
listen = /usr/local/php72/sockets/$pool.sock
listen.owner = $pool
listen.group = apache
listen.mode = 660
Code:
# ls /usr/local/php56/etc
pear.conf  php-fpm.conf.default
Code:
# ps auxfw | grep php-fpm
root      3321  0.0  0.0 103584   880 pts/0    S+   01:26   0:00          \_ grep php-fpm
root      3115  0.0  0.3 226740  7108 ?        Ss   01:21   0:00 php-fpm: master process (/usr/local/php72/etc/php-fpm.conf)
Code:
# service httpd status
httpd (pid  2089) is running...
Code:
# service nginx status
nginx (pid  3087) is running...
Code:
# sestatus
SELinux status: disabled
Code:
# ls -d /usr/local/php*/
/usr/local/php/  /usr/local/php5/  /usr/local/php55/  /usr/local/php56/  /usr/local/php6/  /usr/local/php72/
Code:
# service --status-all | grep fpm
Usage: /etc/init.d/php-fpm72 {start|stop|restart|force-quit|reload|graceful}Status for pm2:
SIOCADDRT: File exists
In directadmin web panel:

Code:
Service	Status	Memory Usage	Start	Stop	Restart	Reload
directadmin	directadmin (pid 2049 3719 3720 3721 3722 3723 )	9.43 MB	Start	Stop	Restart	Reload
dovecot	dovecot (pid 1795 )	51.9 MB	Start	Stop	Restart	
exim	exim (pid 2064 )	1.39 MB	Start	Stop	Restart	Reload
httpd	httpd (pid 2089 2109 2111 )	41.1 MB	Start	Stop	Restart	Reload
lfd	Process is stopped	0 B	Start	Stop	Restart	Reload
mysqld	mysqld (pid 2048 )	129.3 MB	Start	Stop	Restart	Reload
named	named (pid 3058 )	12.9 MB	Start	Stop	Restart	Reload
nginx	nginx (pid 3087 3088 3089 )	91.4 MB	Start	Stop	Restart	Reload
php-fpm56	Process is stopped	0 B	Start	Stop	Restart	Reload
php-fpm72	php-fpm72 (pid 3115 )	6.95 MB	Start	Stop	Restart	Reload
proftpd	proftpd (pid 3192 )	2.00 MB	Start	Stop	Restart	
sshd	sshd (pid 1869 2641 )	5.23 MB	Start	Stop	Restart	Reload
When click on `Reload` of `php-fpm56` service, I got this error:
Code:
Cannot find the script
Details
/etc/init.d/php-fpm56

Code:
# ./build rewrite_confs
:
:
Gracefully shutting down php-fpm72: . done
Starting php-fpm72:  done
./build: line 12467: /etc/init.d/php-fpm56: No such file or directory
error reading information on service php-fpm56: No such file or directory
:
:

Solve:
Now, I did many research and resolve this problem manually by trial and error with this commands:

Code:
# cp /etc/init.d/php-fpm72 /etc/init.d/php-fpm56
# sed -i 's/72/56/g' /etc/init.d/php-fpm56
# cp /usr/local/php72/etc/php-fpm.conf /usr/local/php56/etc/php-fpm.conf
# sed -i 's/72/56/g' /usr/local/php56/etc/php-fpm.conf
# mkdir /usr/local/php56/sockets/
# chown apache:apache /usr/local/php56/sockets/
# chmod 700 /usr/local/php56/sockets/
Test:
Code:
# service php-fpm56 graceful
Gracefully reloading service php-fpm56:  done
Question:
Now I think that maybe this has been a bug in directadmin and I'm not sure what I did to solve the problem was right and principled.
What is the cause of this problem and is there a better way to fix the problem?
 
I got the similar problem with PHP 7.3 and PHP 7.2. PHP 7.3 is working fine but the 7.2 got problem as you mentioned.
 
Hello,

Make sure you've completed compilation/installation of PHP 7.2/7.3

You should have PHP version's details running the commands:

Code:
/usr/local/php72/bin/php -v

Code:
/usr/local/php73/bin/php -v
 
Back
Top