PHP-FPM Can Not Connect to Mysql through LOCALHOST, only 127.0.0.1

Mike Grotton

Registered
Feb 17, 2019
1
0
1
Maine
cPanel Access Level
Website Owner
This issue is affecting PHP-FPM only. If I have it enabled for an account, that account can't connect to databases using 'Localhost', I have to specify '127.0.0.1'

If I disable PHP-FPM for that account, it is able to connect to DB fine with no further configuration changes.
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,110
659
263
Houston
cPanel Access Level
DataCenter Provider
What is in /etc/hosts

It would seem to me that php-fpm is not reading /etc/hosts or there is something misconfigured in /etc/hosts
My assumption as well but after looking at the cPanel Access Level for him I believe he would need to go through his provider for assistance with this.