|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-07-03 16:28 UTC] veins at kheos dot net
I am using php-4.0.6 with MySQL-3.23.39 and there seems to be a problem with connecting to the database server. Problem that didn't happen with any previous version (even php-4.0.5 that i was using till today). phpinfo() shows a correct configuration and correct path to the socket, mysql server works correctly from console and i'm not using the bundled libraries (tried them also and it gave the same error). This was reproductible under OpenBSD-2.7-stable, OpenBSD-2.8, OpenBSD-2.8-stable, OpenBSD-2.9, OpenBSD-2.9-stable, Linux Debian (current), Linux RedHat 7.0, Linux Slackware 7.1 and probably others.
Configuration flags of PHP are:
--with-apache=/usr/local/apache --with-mysql=/usr/local/mysqlc --with-openssl=/usr/local/ssl --with-gd=/usr/local/gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-zlib-dir=/usr/local --with-ttf=/usr/local --enable-apc --enable-calendar --enable-bcmath --enable-track-vars
MySQL related configuration directives in php.ini are:
mysql.allow_persistent = Off
mysql.max_persistent = 0
mysql.max_links = 1000
mysql.default_port = 3306
mysql.default_socket = /usr/local/mysqlc/var/mysql.sock
mysql.default_host = localhost
MySQL was compiled with the following flags:
--enable-static --localstatedir=/usr/local/mysqlc/var --with-libwrap=/usr --with-mysqld-user=mysqlc --with-unix-socket-path=/usr/local/mysqlc/var/mysql.sock --with-tcp-port=3306 --without-bench --without-mit-threads
Error returned:
Warning: Can't connect to local MySQL server through socket '/usr/local/mysqlc/var/mysql.sock' (13) in /home/www/k/kheos.net/test.php on line 3
Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/usr/local/mysqlc/var/mysql.sock' (13) in /home/www/k/kheos.net/test.php on line 3
Script that returned the error:
<? mysql_connect("localhost","joeuser","joepassword"); ?>
By the way, if someone would care to write a patch for:
http://www.php.net/bugs.php?id=11767
I'd appreciate it cause i got poor C skills ;p
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
By the way, i've been testing a few things and php will connect to the database if i trick it into using tcp connection instead of socket connection and using LAN ip address instead of 'localhost' or loopback IP address. Won't work: <? mysql_connect("localhost:3306", "me","mypass"); ?> Won't work either: <? mysql_connect("localhost:/path/to/socket", "me","mypass"); ?> Works (when i define sql to be LAN ip address of server): <? mysql_connect("sql", "me","mypass"); ?>