Really strange problem and i do not found working solution for hours. My Desktop-Setup (WinPc, XAMPP, Win7) is working great. My Laptop-Setup (MacBook, XAMPP, MacOs10.12) is not.
I try to connect to an external MySQL(i) Database from php.
I tried MAMP and XAMPP and always get the same solution. Connecting to the local Database Server (localhost) via php is working fine.
If i try to connect to external mysql-database, webbrowser is freezing - after a while I get a TIME OUT.
Warning: mysqli::mysqli(): (HY000/2002): Operation timed out in Fatal error: Failed to connecto to MySQLi: Operation timed out in
I guess the problem is somewhere at the mysql or the macOS, but i don't know where to search or what is blocking.
I can ping/telnet the remote host and i get answer. The same script (same database login data) is working on the pc/windows machine.
There is no problem with the remote database server. I can connect from windows machine and also i can connect from mac with the database tool "db beaver". But I cant´t connect via php.
SOLUTION: maybe the many installs from MAMP and XAMPP did anything to the osx. Reinstall from XAMPP and reboot did fix everything.