Posts

Showing posts with the label firewall

Set Outgoing ip for remote php mysql connection

Set Outgoing ip for remote php mysql connection I have php application with separate host for both application and database, Lets say my application is hosted on Ip1, and db is hosted on Ip2, both apllication and Db is in separate network, now application server is behind the firewall, my firewall has two ips fw1,fw2 for failover purpose, for both firewall ips, rule has been set to allow connection from ip1 to ip2. Now the problem is one of the firewall ip fw1 is down, and my application is still going to connect db hosted on ip2 through fw1, resulting in fatal error PDO CONNECTION ERROR: SQLSTATE[HY000] [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. Is there any way in php,mysql, i can define Outgoing ip for remote mysql connection, so i can direct application to make connection through fw2 instead of fw1. I can do this in case of curl...