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 request through CURLOPT_INTERFACE
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Question seems very hard for all Experts !!!!!
– user3782114
Jul 4 at 18:26