I just compiled PHP 7.0.4 on a Fedora 23 box, created a test script to connect to MySQL on localhost and all I get is:
Error: Unable to connect to MySQL. Debugging errno: 2002 Debugging error: No such file or directory According to PHP that is because PHP cannot find /tmp/mysql.sock, the file does exist, so I reconfigured MySQL and PHP to have them both point to the same file, without success, this is what /tmp shows about mysql.sock:
lrwxrwxrwx 1 root root 25 Mar 21 10:13 mysql.sock -> /var/lib/mysql/mysql.sock I don't know what to do at this point, because when I change the script to connect to 127.0.0.1, it works just fine.
Others at stackoverflow told me to post this here to see if I can get more help, because there is nothing wrong with the code I'm using to connect. (Related Question: https://stackoverflow.com/questions/36065587/php-not-seeing-mysql-sock-from-the-web)
Finally, my Firewall is masked and my selinux is disabled and I also tested it from the console and it works, it doesn't work only via web even though phpinfo() shows this.
mysqli.default_socket /tmp/mysql.sock /tmp/mysql.sock
dig localhostand post results?so I reconfigured MySQL and PHP to have them both point to the same file. Can you post bothphp.iniandmy.cnf?