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

Product Owner
Staff member
Nov 14, 2017
13,295
1,255
313
Houston
Hi @Mike Grotton


That seems odd, what's in the .htaccess for the domain? Also, have you discussed this issue with your provider? It's possible they have some configurations that are preventing this from working as intended.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,255
313
Houston
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.