Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16551 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34211 invoked by uid 1010); 8 Jun 2005 15:09:51 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 34195 invoked from network); 8 Jun 2005 15:09:51 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 8 Jun 2005 15:09:51 -0000 X-Host-Fingerprint: 62.39.83.9 postfix07.aic.fr Linux 2.4/2.6 Received: from ([62.39.83.9:36664] helo=postfix07.aic.fr) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id 9B/D8-52832-B3A07A24 for ; Wed, 08 Jun 2005 11:09:47 -0400 Received: from localhost (postfix07.aic.fr [127.0.0.1]) by postfix07.aic.fr (Postfix) with ESMTP id 9A5154B414B for ; Wed, 8 Jun 2005 17:09:43 +0200 (CEST) Received: from postfix07.aic.fr ([127.0.0.1]) by localhost (postfix07.aic.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23541-06 for ; Wed, 8 Jun 2005 17:09:42 +0200 (CEST) Received: from [10.0.22.47] (unknown [10.0.22.47]) by postfix07.aic.fr (Postfix) with ESMTP id 650764B428F for ; Wed, 8 Jun 2005 17:09:41 +0200 (CEST) Message-ID: <42A70984.1060808@spectreanime.com> Date: Wed, 08 Jun 2005 17:06:44 +0200 User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at aic.fr Subject: Mysql socket From: webmaster@spectreanime.com (PAGES Vincent) 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