php-install Digest 23 Sep 2001 21:56:31 -0000 Issue 471 Topics (messages 4373 through 4383): Re: MYSQL support 4373 by: Rasmus Lerdorf 4374 by: Ashley M. Kirchner 4375 by: Stefan Siefert 4376 by: Rasmus Lerdorf 4377 by: Ashley M. Kirchner 4378 by: Jeremy Wadsack 4379 by: Ashley M. Kirchner 4380 by: Jeremy Wadsack 4381 by: Rasmus Lerdorf 4382 by: Ashley M. Kirchner how to upgrade? 4383 by: Matt Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
This is usually caused by a client library mismatch. If you have the mysql client library installed on your system, use: --with-mysql=/usr Assuming your mysql client libs are under /usr/lib somewhere. That should fix it. Otherwise you can specify the socket location right in the mysql_connect() call. See php.net/mysql_connect -Rasmus On Sat, 22 Sep 2001, Ashley M. Kirchner wrote: > > How can I tell configure where my mysql.sock is located? It seems > to like using /tmp/mysql.sock, however that's not where my mysql socket > is. > > -- > W | I haven't lost my mind; it's backed up on tape somewhere. > +-------------------------------------------------------------------- > Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 > IT Director / SysAdmin / WebSmith . 800.441.3873 x130 > Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6 > http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A. > > > >
Rasmus Lerdorf wrote: > This is usually caused by a client library mismatch. If you have the > mysql client library installed on your system, use: > > --with-mysql=/usr Actually, I did a custom install. mySQL, plus relevant includes and libraries are all under /usr/local. The datafiles are under /usr/local/var/mysql, which is also default installation, however I configured it to also drop my socket in there (/usr/local/var/mysql/mysql.sock), and there is no way to instruct PHP's configure to account for that. Looking at the configure script, mysql.sock is hard wired to look at specific places, not to allow for a command line option. -- W | I haven't lost my mind; it's backed up on tape somewhere. +-------------------------------------------------------------------- Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6 http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
hi, hm not sure about but couldn't a symlink help? maybe you should try a symlink /tmp/mysql.sock to the real one.. I'm not sure if you can trick php with this but theoreticaly it could be possible. Greetings, Stefan Siefert ----- Original Message ----- From: Ashley M. Kirchner <[EMAIL PROTECTED]> To: PHP-Install List <[EMAIL PROTECTED]> Sent: Saturday, September 22, 2001 11:13 PM Subject: Re: [PHP-INST] MYSQL support > Rasmus Lerdorf wrote: > > > This is usually caused by a client library mismatch. If you have the > > mysql client library installed on your system, use: > > > > --with-mysql=/usr > > Actually, I did a custom install. mySQL, plus relevant includes and > libraries are all under /usr/local. The datafiles are under > /usr/local/var/mysql, which is also default installation, however I > configured it to also drop my socket in there > (/usr/local/var/mysql/mysql.sock), and there is no way to instruct PHP's > configure to account for that. Looking at the configure script, mysql.sock > is hard wired to look at specific places, not to allow for a command line > option. > > -- > W | I haven't lost my mind; it's backed up on tape somewhere. > +-------------------------------------------------------------------- > Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 > IT Director / SysAdmin / WebSmith . 800.441.3873 x130 > Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6 > http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A. > > > > -- > PHP Install Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
PHP hasn't hardwired anything. The MySQL library which ships with PHP does have this hardwired, but that is why I told your to use --with-mysql=/path which tells PHP to not use the built-in library and to use the system one which has the correct socket location built in. -Rasmus > Rasmus Lerdorf wrote: > > > This is usually caused by a client library mismatch. If you have the > > mysql client library installed on your system, use: > > > > --with-mysql=/usr > > Actually, I did a custom install. mySQL, plus relevant includes and > libraries are all under /usr/local. The datafiles are under > /usr/local/var/mysql, which is also default installation, however I > configured it to also drop my socket in there > (/usr/local/var/mysql/mysql.sock), and there is no way to instruct PHP's > configure to account for that. Looking at the configure script, mysql.sock > is hard wired to look at specific places, not to allow for a command line > option. > > -- > W | I haven't lost my mind; it's backed up on tape somewhere. > +-------------------------------------------------------------------- > Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 > IT Director / SysAdmin / WebSmith . 800.441.3873 x130 > Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6 > http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A. > > > >
Rasmus Lerdorf wrote: > PHP hasn't hardwired anything. The MySQL library which ships with PHP > does have this hardwired, but that is why I told your to use > --with-mysql=/path which tells PHP to not use the built-in library and to > use the system one which has the correct socket location built in. I did. --with-mysql=/usr/local still says the socket is in /tmp/mysql.sock when it's not. It's in /usr/local/var/mysql/mysql.sock. mySQL is running fine, and the socket is _not_ in /tmp/mysql.sock. So why does PHP insist on it being there? -- W | I haven't lost my mind; it's backed up on tape somewhere. +-------------------------------------------------------------------- Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6 http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
Ashley M. Kirchner ([EMAIL PROTECTED]): > Rasmus Lerdorf wrote: >> PHP hasn't hardwired anything. The MySQL library which ships with PHP >> does have this hardwired, but that is why I told your to use >> --with-mysql=/path which tells PHP to not use the built-in library and to >> use the system one which has the correct socket location built in. > I did. --with-mysql=/usr/local still says the socket is in /tmp/mysql.sock > when it's not. It's in /usr/local/var/mysql/mysql.sock. mySQL is running fine, > and the socket is _not_ in /tmp/mysql.sock. So why does PHP insist on it being > there? I've always had this "problem" with PHP/MySQL installs. And always used the --with-mysql setting to point to the only library installed on the system (which therefore matches the mysqld installed on the system). mysqld allows you to specify the location of the socket file in the command-line when you call it. So, you could change your mysql startup script to tell it to put the socket file in /tmp/mysql.sock. I find it much easier, however, to symlink it as Stefan suggested. The only problem I have with this is that some systems have a 'cleanup' routine that empties /tmp on startup/shutdown (since /tmp is supposed to be temporary) and thus deletes the symlink. It would be better if PHP configure could be told where to find the mysql.sock file, although I admit adding *more* options to PHP configure is not something I think anyone really wants to do. :-) -- Jeremy Wadsack Wadsack-Allen Digital Group
Jeremy Wadsack wrote: > I've always had this "problem" with PHP/MySQL installs. And always > used the --with-mysql setting to point to the only library installed > on the system (which therefore matches the mysqld installed on the > system). Did that and it found the mySQL installation, but refused to find the socket where it actually is. > mysqld allows you to specify the location of the socket file in the > command-line when you call it. So, you could change your mysql startup > script to tell it to put the socket file in /tmp/mysql.sock. That's not the point, nor what I want to do. I have specifically told mySQL when I build it, to drop it's socket into something other than /tmp/mysql.sock. The system is configured to clean out /tmp once a week, and it'd be stupid to have the socket, or any persistent socket in there. PHP has no way of being told (on the COMMAND LINE) where the socket is. So, as Rasmus pointed out, one has to set it in the .ini file since it always defaults to /tmp/mysql.sock, for whatever reason. AMK4 -- W | I haven't lost my mind; it's backed up on tape somewhere. +-------------------------------------------------------------------- Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6 http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
Ashley M. Kirchner ([EMAIL PROTECTED]): > Jeremy Wadsack wrote: >> I've always had this "problem" with PHP/MySQL installs. And always >> used the --with-mysql setting to point to the only library installed >> on the system (which therefore matches the mysqld installed on the >> system). > Did that and it found the mySQL installation, but refused to find the socket >where > it actually is. I know. What I was saying (perhaps not clearly) is that if PHP is supposed to figure this out from the MySQL installation, it has never done it on the several dozen PHP/MySQL installs I have done. I was confirming the bug. >> mysqld allows you to specify the location of the socket file in the >> command-line when you call it. So, you could change your mysql startup >> script to tell it to put the socket file in /tmp/mysql.sock. > That's not the point, nor what I want to do. I have specifically told mySQL when > I build it, to drop it's socket into something other than /tmp/mysql.sock. Again, I wasn't implying that this was good a solution to your problem. I meant to suggest that it was one solution and that there are show that mysqld may not even put the socket file in the place where you tell it, which may have nothing to do with compile-time settings. > The system is configured to clean out /tmp once a week, and it'd be > stupid to have the socket, or any persistent socket in there. I think I said that. I don't think PHP should be configured to look there by default for that very reason. A better default would probably be /var/mysql.sock. > PHP has no way of being told (on the COMMAND LINE) where the socket > is. So, as Rasmus pointed out, one has to set it in the .ini file > since it always defaults to /tmp/mysql.sock, for whatever reason. Ah... I haven't gotten that response yet, I don't think. The .ini file solution seems the best (although configure setting would be nice). I'll do that on the systems I've setup. Thanks, -- Jeremy Wadsack Wadsack-Allen Digital Group
Well, PHP gets that path from the mysql client library, so if it isn't getting the right one then your client library is wrong. Check it: strings /usr/lib/libmysqlclient.so | grep sock Mine outputs: /var/lib/mysql/mysql.sock -Rasmus On Sat, 22 Sep 2001, Ashley M. Kirchner wrote: > Rasmus Lerdorf wrote: > > > PHP hasn't hardwired anything. The MySQL library which ships with PHP > > does have this hardwired, but that is why I told your to use > > --with-mysql=/path which tells PHP to not use the built-in library and to > > use the system one which has the correct socket location built in. > > I did. --with-mysql=/usr/local still says the socket is in /tmp/mysql.sock > when it's not. It's in /usr/local/var/mysql/mysql.sock. mySQL is running fine, > and the socket is _not_ in /tmp/mysql.sock. So why does PHP insist on it being > there? > > -- > W | I haven't lost my mind; it's backed up on tape somewhere. > +-------------------------------------------------------------------- > Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 > IT Director / SysAdmin / WebSmith . 800.441.3873 x130 > Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6 > http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A. > > > >
Rasmus Lerdorf wrote: > Well, PHP gets that path from the mysql client library, so if it isn't > getting the right one then your client library is wrong. Check it: > > strings /usr/lib/libmysqlclient.so | grep sock Mine outputs: # strings /usr/local/lib/mysql/libmysqlclient.so | grep sock /usr/local/var/mysql.sock ...where is PHP configure finding /tmp/mysql.sock? AMK4 -- W | I haven't lost my mind; it's backed up on tape somewhere. +-------------------------------------------------------------------- Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6 http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
I want to upgrade my 4.0.3x to 4.0.6; is there anything I should do/not do so as to not screw up my current (working) php? yes, i am ignorant. i haven't touched it since i initially got it working with my older apache and mysql. thx matt