ID: 45179 Updated by: [EMAIL PROTECTED] Reported By: daniel dot fallon at nuim dot ie -Status: Verified +Status: Closed Bug Type: MySQL related Operating System: CentOS 4.5 PHP Version: 5.2.6 Assigned To: andrey New Comment:
This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Thank you for your report! >From now on, --with-mysql-sock will apply to all 3 MySQL extensions: - ext/mysql - mysqli - pdo_mysql It will be the default value for the socket connections unless another value is specified in php.ini (.htaccess) Previous Comments: ------------------------------------------------------------------------ [2008-06-04 18:21:12] teefee at test dot com A suggested fix (elsewere) was simply to encase the #define MYSQL_UNIX_ADDR statement in mysql_version.h in an #ifndef/#endif pair. This appears to work on the face of things, with no warnings and phpinfo() reporting MYSQL_SOCKET as the socket defined in configure. However, PHP still looks to /tmp/mysql.sock for the socket which results in a connection failure. ------------------------------------------------------------------------ [2008-06-04 17:18:29] daniel dot fallon at nuim dot ie Description: ------------ When using --with-mysql=/usr/local/mysql and having a nonstandard socket (/home/databases/mysql/mysql.sock), the compiler throws a warning and fails to compile PHP with the socket that was given via the --with-mysql-sock option I'm using PHP 5.2.6 and mySQL 5.0.51b (compiled from source) /bin/sh /usr/src/php-5.2.6/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/mysql/ -I/usr/src/php-5.2.6/ext/mysql/ -DPHP_ATOM_INC -I/usr/src/php-5.2.6/include -I/usr/src/php-5.2.6/main -I/usr/src/php-5.2.6 -I/usr/include/libxml2 -I/usr/src/php-5.2.6/ext/date/lib -I/usr/local/mysql/include/mysql -I/usr/src/php-5.2.6/TSRM -I/usr/src/php-5.2.6/Zend -g -O2 -prefer-non-pic -c /usr/src/php-5.2.6/ext/mysql/php_mysql.c -o ext/mysql/php_mysql.lo In file included from /usr/local/mysql/include/mysql/mysql.h:71, from /usr/src/php-5.2.6/ext/mysql/php_mysql.c:67: /usr/local/mysql/include/mysql/mysql_version.h:18:1: warning: "MYSQL_UNIX_ADDR" redefined In file included from /usr/src/php-5.2.6/TSRM/tsrm_config.h:1, from /usr/src/php-5.2.6/TSRM/tsrm_config_common.h:13, from /usr/src/php-5.2.6/TSRM/tsrm_virtual_cwd.h:26, from /usr/src/php-5.2.6/main/php.h:412, from /usr/src/php-5.2.6/ext/mysql/php_mysql.c:32: /usr/src/php-5.2.6/include/../main/php_config.h:1891:1: warning: this is the location of the previous definition Reproduce code: --------------- ./configure --with-pear=/usr/lib/pear --with-mysql=shared,/usr/local/mysql --with-mysql-sock=/home/databases/mysql/mysql --with-zlib-dir=/usr/include --with-zlib=shared --with-apxs2=/usr/local/apache2/bin/apxs Expected result: ---------------- PHP to throw no warnings during compile and use the new socket that I defined through configure. I expect phpinfo()'s MYSQL_SOCKET value to report the specified socket Actual result: -------------- phpinfo() shows MYSQL_SOCKET as /tmp/mysql.sock which is the value in mysql_version.h There's a number of previous bug reports for this same issue, I don't know what's happening to the fixes but it's not working at the minute. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45179&edit=1