Hi,

I hope i'm writing in the good mailing list...

Since one year, i'm working on loadbalancing solution for webservers (usually Apache 2). Behind a cluster of http servers, we can find a mysql cluster. Generally ppl are using the mysql_connect with the hostname = "localhost". When i suggest a loadbalancing solution, the mysql database is hosted on a different server. So webpages of all virtual hosts need to be updated to connect on the new hostname; which can be very annoying.

I've patched PHP, and added 2 variables in PHP.ini which are :
   mysql.unix_socket = disabled
   mysql.force_hostname =

The first one disabled the connection on mysql unix socket and transform "localhost" in "127.0.0.1". This allows to redirect mysql traffic with iptables. The second force mysql_connect to one database whatever the hostname specified in the mysql_connect function.

I think it can be someting helpful for System Administrators. Tell me ur feeling about this.

--
PAGES Vincent
System Administrator
France

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to