Re: PHP 4.0 Bug #5823: PHP assumes MySQL unix socket is always available

From: Date: Sun, 30 Jul 2000 15:06:59 +0000
Subject: Re: PHP 4.0 Bug #5823: PHP assumes MySQL unix socket is always available
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-26959@lists.php.net to get a copy of this message
> Rasmus Lerdorf wrote: > > The problem I see with this patch is that it only checks to see if the > > unix domain socket is there, not whether it is supported on the > > system. > > The unix sockets are supported virtually on any Unix-like system. > If you mean if they are supported/used by MySQL - that is ~impossible > to do, if you do not want to resort to some dirty hackery. > > > It is not uncommon for the mysql client library and the server to > > disagree on where this unix domain socket is supposed to be. > > This is fatal configuration error. They should only disaggree if > the administrator messed with client code, in which case > they would be very aware of supposed ramifications. Particalirily, > I don't think that PHP should baby-sit such broken configurations > or incompetent admins, and should just use whatever communication > type is available, i.e. TCP/IP if the unix socket is not where > it's supposed to be. But it can easily be worked around by providing the path to the unix domain socket in the mysql_connect() line. My worry is falling back on a slower mechanism without the user knowing this is happening. > And, BTW - this chunk of code seems to only used if PHP is compiled > with it's bundled mysql code and it should be OK when using > mysqlclient library. IMHO PHP should not have any bundled MySQL > client library at all and just rely on that of system it's compiled > on. Besides unnecessary bloat (it adds about 150KB compressed to > distibution tar.gz, and about 100KB to compiled libphp4.so if used > instead of shared mysqlclient), this would prevent lossages like > the one described in the PR. Or, optionally, distribute PHP with > client libraries for all extensions you support ;-), for consistency > sake. The size of the binary is completely irrelevant. -Rasmus

« previous php.dev (#26959) next »