#50231 [Fbk->Opn]: Socket path passed using --with-mysql-sock is ignored when mysqlnd is enabled

From: Date: Sat, 21 Nov 2009 11:07:25 +0000
Subject: #50231 [Fbk->Opn]: Socket path passed using --with-mysql-sock is ignored when mysqlnd is enabled
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-144905@lists.php.net to get a copy of this message
 ID:               50231
 User updated by:  foutrelis at gmail dot com
 Reported By:      foutrelis at gmail dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         MySQL related
 Operating System: Arch Linux
-PHP Version:      5.3.0
+PHP Version:      5.3.1
 New Comment:

Changing status back to "Open" (from "Feedback") and version to 5.3.1
(from 5.3.0).


Previous Comments:
------------------------------------------------------------------------

[2009-11-19 22:15:26] foutrelis at gmail dot com

The pdo_mysql extension is affected as well. When mysqlnd is enabled,
PDO_MYSQL_UNIX_ADDR doesn't get defined and it uses /tmp/mysql.sock
instead of the path retrieved using `mysql_config --socket'.

In this case, the code in ext/pdo_mysql/config.m4 is a bit more
involved, so I won't attempt to come up with a patch. :>

------------------------------------------------------------------------

[2009-11-19 15:45:26] foutrelis at gmail dot com

Tried with the snapshot; same problem.

 [foutrelis@foutboxd php]$ php -r 'mysql_connect();'
 PHP Warning:  mysql_connect(): [2002] No such file or directory
(trying to connect via unix:///tmp/mysql.sock) in Command line code on
line 1
 PHP Warning:  mysql_connect(): No such file or directory in Command
line code on line 1


`php -i' output: http://omploader.org/vMnQxNQ/phpinfo.txt

------------------------------------------------------------------------

[2009-11-19 15:06:51] jani@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/



------------------------------------------------------------------------

[2009-11-19 14:55:14] foutrelis at gmail dot com

Description:
------------
Looking at ext/mysql/config.m4, it seems to me that the path specified
during the ./configure step using the --with-mysql-sock option gets
ignored and PHP_MYSQL_UNIX_SOCK_ADDR isn't defined accordingly. This
causes mysqlnd to always use its default socket path (/tmp/mysql.sock).

I wrote a patch [1] to move the related code in its own if clause so
that it gets executed regardless of whether mysqlnd or libmysqlclient is
used. However, I was unable to test it because I'm not sure how to
regenerate the configure script (I tried with autoreconf but the
produced configure script freaked out; something about confdefs.h
missing).

Let me know if you need any more information from me.

----
[1] http://bugs.archlinux.org/task/17179?getfile=4423



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=50231&edit=1



Thread (6 messages)

« previous php.bugs (#144905) next »