Indicates that the remote server is remotely reachable.
I encountered the problem is this: there are three servers a,b,c, C for the server, B can be successfully connected to PHP with the C machine MySQL, and a machine can not connect!
It can be said that the code is not the problem, the MySQL server on the setup is no problem, because B machine can be.
There must be a problem with the setup of a machine!
A search on the internet, a variety of said MySQL licensing issues, as well as modify the php.ini, modify the firewall, in fact, is not the cause of these problems.
Finally thought of the selinux of the problem, compared to the next AB two machines, and indeed set a different! I guess it's the problem.
The following settings are made:
Under root, open the file file with vim/etc/selinux/config
To modify the value of SELinux:
#SELINUX =enforcing
Selinux=disabled
Save and exit.
Reboot is in effect, if you do not want to reboot, command line input
Setenforce 0
Enter, OK