|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-10-29 13:33 UTC] svn@php.net
[2009-10-29 13:34 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 09 18:00:02 2025 UTC |
Description: ------------ since 5.3.0, the PDO Mysql driver doesn't use the --with-mysql-sock configure option (help says : --with-mysql-sock[=DIR] MySQL/MySQLi/PDO_MYSQL: Location of the MySQL unix socket pointer.) and always uses /tmp/mysql.sock. Patch below: --- pdo_mysql.c.orig 2009-10-27 18:02:56.000000000 +0100 +++ pdo_mysql.c 2009-10-27 19:15:38.000000000 +0100 @@ -40,7 +40,11 @@ #ifndef PHP_WIN32 # ifndef PDO_MYSQL_UNIX_ADDR -# define PDO_MYSQL_UNIX_ADDR "/tmp/mysql.sock" +# ifdef PHP_MYSQL_UNIX_SOCK_ADDR +# define PDO_MYSQL_UNIX_ADDR PHP_MYSQL_UNIX_SOCK_ADDR +# else +# define PDO_MYSQL_UNIX_ADDR "/tmp/mysql.sock" +# endif # endif #endif Reproduce code: --------------- ./configure --with-mysql-sock=/var/run/mysqld/mysqld.sock [...] && make && make install and then: php -r 'new PDO("mysql:host=localhost");' Expected result: ---------------- nothing Actual result: -------------- Warning: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in Command line code on line 1