.sock files for php selector not functioning

ReN

Verified User
Joined
Jul 2, 2005
Messages
202
This has also been sent to DA support, i put it here also incase it happens to someone else.

hey guys, Hopefully this is an easy one, when changing the php version for a domain via php selector, the site fails to load. Checking the logs, tells me a socket error “[proxy:error] [pid 18396] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /usr/local/php73/sockets/xxxxxx.sock (*) failed, check the folder, there is no .sock file for that user/reseller. if I do a manual rewrite_conf in custombuild the file gets created. Any suggestions or help be greatly appeciate.
P.S Os is FreeBSD 11.3
 
Hello,

Does the socket file get removed after PHP-FPM restart too? Or it's only about a socket file which does not get created on PHP version change?
 
ok guys, just pasting this here for completeness ( message from John in Support)

My first suspicion would be that php-fpm isn't being fully restart/reloaded.


Test changing the php version, then check:
/var/log/directadmin/system.log


to see if you can spot the php-fpm versions being restarte/reloaded:
2020:02:16-18:24:01: httpd reloaded
2020:02:16-18:24:01: php-fpm70 reloaded
2020:02:16-18:24:01: php-fpm73 reloaded


If you ARE seeing that.. then check the User to ensure their php-fpmXX.conf is present:
cd /usr/local/directadmin/data/users/username/php/
ls -la


as php-fpmXX does a sweep of this folder, eg:
/usr/local/php73/etc/php-fpm.conf :
--
; Load all DA User configs
include=/usr/local/directadmin/data/users/*/php/php-fpm73.conf


So if the User conf exists, then suspect cause of the missing sock would be a proper reload/restart of php-fpm.


============


Assuming the above is true..and the reload is the issue.. check the wording from the system log to know if it shows "reloaded" or "restarted"
Test this manually to see if that creates the missing sock, eg:
/usr/local/etc/rc.d/php-fpm73 reload


if that doesn't do the trick, but a full php-fpm73 restart does work, then DA can be flipped to do a full restart:
cd /usr/local/directadmin
./directadmin set php_fpm_restarts 1


but debugging why the reload isn't kicking in is likely the best choice...
Might just be an out-of-sync master PID.. .


or compare your scripts with the recent one:
http://files1.directadmin.com/services/custombuild/php-fpm.freebsd


and be sure to update the PHP_VER=53 to the correct version.

Thank you,

John
-----------------------------------------------------
DirectAdmin Web Control Panel
https://tickets.directadmin.com
 
OK, and what did you find? Is it about PHP-FPM being not properly restarted?
 
Ok this helped me pinpoint where the issue is

My first suspicion would be that php-fpm isn't being fully restart/reloaded.


Test changing the php version, then check:
/var/log/directadmin/system.log


to see if you can spot the php-fpm versions being restarte/reloaded:
2020:02:16-18:24:01: httpd reloaded
2020:02:16-18:24:01: php-fpm70 reloaded
2020:02:16-18:24:01: php-fpm73 reloaded

Some background first, i have the 4 php versions in the options.conf in order of
7.2 ( default ) / 5.6 / 7.3 & 7.4

when i change the php selector to say 7.3 the /var/log/directadmin/system.log seems to only restart the first 2

2020:02:17-03:30:04: httpd restarted
2020:02:17-03:30:04: php-fpm56 gracefuled
2020:02:17-03:30:04: php-fpm72 gracefuled

i can confirm a manual restart of the php-fpm73 does work and functions as it should.
 
if that doesn't do the trick, but a full php-fpm73 restart does work, then DA can be flipped to do a full restart:
cd /usr/local/directadmin
./directadmin set php_fpm_restarts 1

In anycase, this got me going again and the system.log shows

2020:02:17-03:47:04: httpd restarted
2020:02:17-03:47:05: php-fpm56 restarted
2020:02:17-03:47:06: php-fpm72 restarted
2020:02:17-03:47:06: php-fpm73 restarted
2020:02:17-03:47:07: php-fpm74 restarted

so i'll debug further and get back to yas :)
 
OK, and what did you find? Is it about PHP-FPM being not properly restarted?

yes mate, ty for responding, it got me started in the right direction :)
TY John for the responce
 
Back
Top