Web lists-archives.com

php-fpm unable to connect to active socket

I changed from PHP 5.6.30 to PHP 7.2.9 and now I am unable to run scripts that
access pgsql using socket 5432.  The old PHP 5.6.30 works as expected.

The configuration is apache using php-fpm to execute the PHP scripts.  scripts
that use PHP but do not connect to the database seem to work OK but haven't been
fully tested yet.  

php-fpm is started using the systemd script included with the download. 
Formerly PHP 5.6.30 was started as an init.d script.

Error message is:

Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect
to server: No such file or directory Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"? 

ls -a /tmp/.s.*

ss -a | grep 5432
u_str  LISTEN     0      128    /tmp/.s.PGSQL.5432 29050                 * 0   

Restarting PHP 5.6.30 immediately reconnects to socket 5432 as always and all
scripts calling the database work as expected.  I have stopped and started both
versions of PHP multiple times, and also pgsql, so it doesn't appear to be a
lock on the socket from PHP 5.6.30 causing the problem.

The configure parameters to make are (taken from php_info):

'./configure' '--prefix=/usr/php-7.2.9' '--with-apxs2=/usr/apache-
2.4.25/bin/apxs' '--enable-fpm' '--with-fpm-user=phpfpm' '--with-fpm-
group=phpfpm' '--with-fpm-systemd' '--disable-short-tags' '--with-
openssl=/usr/openssl-1.1.0i' '--with-zlib' '--with-pgsql=/usr/postgres-9.6.2' '-
-with-pear' '--with-libxml-dir=/usr/lib64' 

Can anyone see anything that might be causing this?  Or suggest some way to try
and debug it?

Thanks in advance.