php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41422 mysql.default_socket and configure --with-mysql-sock don't work
Submitted: 2007-05-17 20:06 UTC Modified: 2007-05-18 11:55 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: tiago dot tuxkiller at gmail dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4CVS-2007-05-17 (snap) OS: Linux x64
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tiago dot tuxkiller at gmail dot com
New email:
PHP Version: OS:

 

 [2007-05-17 20:06 UTC] tiago dot tuxkiller at gmail dot com
Description:
------------
Hello,

I'm using "PHP Version 4.4.8-dev" (php4-STABLE-200705171830.tar.gz) and still with this problem: (http://bugs.php.net/bug.php?id=32081)

./configure
...
--with-mysql="/data/dbms/mysql4/bin" \
--with-mysql-sock="/tmp/mysql4.sock" \
...

php.ini:
mysql.default_port = 3309
mysql.default_socket = /tmp/mysql4.sock

Result of phpinfo():
Client API version 	4.1.22
MYSQL_MODULE_TYPE 	external
MYSQL_SOCKET 	/tmp/mysql.sock

(I'm using symlinks now... but if I need of another php4 I'll be on problem :-)

Reproduce code:
---------------
Compile one PHP4 and try to change the path of mysql default sock.

Expected result:
----------------
The path can be changed for one new.

Actual result:
--------------
The localization of sock was "hardcoded" on someplace :)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-17 20:11 UTC] tony2001@php.net
make clean && make
 [2007-05-17 20:16 UTC] tiago dot tuxkiller at gmail dot com
Hello Tony.

I was using "php-4.4.7.tar.gz"... and I've tried "make clean" before make && make install.

How don't works, I've tried with "php4-STABLE-200705171830.tar.gz" in another directory, with restart on my apache and etc...

But don't works in any tried, unfortunately.

Thanks
 [2007-05-17 20:21 UTC] tony2001@php.net
--with-mysql="/data/dbms/mysql4/bin"  <-- this does not look like installation _prefix_ 

 [2007-05-17 20:26 UTC] tony2001@php.net
Cannot reproduce:
./configure --disable-all --with-mysql --with-mysql-sock=/whatever/you/want && make

./sapi/cli/php -i | grep what
Configure Command =>  './configure' '--disable-all' '--with-mysql' '--with-mysql-sock=/whatever/you/want'
MYSQL_SOCKET => /whatever/you/want

 [2007-05-17 20:47 UTC] tiago dot tuxkiller at gmail dot com
Hello,

I have 02 MySQL's (v4 and v5) running on this server, and this PHP must see the mysql 4.1.22 that I've compiled with:

./configure \
"--prefix=/data/dbms/mysql4/bin" \
"--enable-thread-safe-client" \
"--with-pthread" \

[mysqld]
port            = 3309
socket          = /tmp/mysql4.sock

This is the line of "configure" that I've used on PHP 4.4.7/-dev:

./configure \
--prefix="/data/php/php4+mysql4/bin-4.4.7" \
--with-freetype-dir="/usr/lib64" \
--with-zlib \
--with-jpeg-dir="/usr/lib64" \
--with-gd \
--with-mysql="/data/dbms/mysql4/bin" \
--with-mysql-sock="/tmp/mysql4.sock" \
--with-ttf \
--with-config-file-path="/data/php/php4+mysql4/bin-4.4.7" \
--with-apxs2="/data/http_servers/apache2+mysql4+php4+mod_auth/bin-2.2.4/bin/apxs" \
--with-mime-magic="/data/http_servers/apache2+mysql4+php4+mod_auth/bin/conf/magic" \
 [2007-05-17 20:56 UTC] tiago dot tuxkiller at gmail dot com
[root@sites-16 source]# ../bin/bin/php -i | grep sock
Configure Command =>  './configure' '--prefix=/data/php/php4+mysql4/bin-4.4.7' '--with-freetype-dir=/usr/lib64' '--with-zlib' '--with-jpeg-dir=/usr/lib64' '--with-gd' '--with-mysql=/data/dbms/mysql4/bin' '--with-mysql-sock=/tmp/mysql4.sock' '--with-ttf' '--with-config-file-path=/data/php/php4+mysql4/bin-4.4.7' '--with-apxs2=/data/http_servers/apache2+mysql4+php4+mod_auth/bin-2.2.4/bin/apxs' '--with-mime-magic=/data/http_servers/apache2+mysql4+php4+mod_auth/bin-2.2.4/conf/magic'
MYSQL_SOCKET => /tmp/mysql.sock
mysql.default_socket => /tmp/mysql4.sock => /tmp/mysql4.sock
default_socket_timeout => 60 => 60


Please, note the MYSQL_SOCKET has different from mysql.default_socket.

Thanks
 [2007-05-17 20:57 UTC] tony2001@php.net
>--prefix="/data/php/php4+mysql4/bin-4.4.7" \
Your ../bin prefixes are totally wrong.

--with-freetype-dir="/usr/lib64" \
--with-jpeg-dir="/usr/lib64" \

"/usr/lib64" is NOT a prefix.
"/usr" is.

>--with-mysql-sock="/tmp/mysql4.sock" \

What do you get with this after you finish 'make':
./sapi/cli/php -i | grep sock
?
 [2007-05-17 20:58 UTC] tony2001@php.net
And what is the value of mysql.default_socket in your php.ini ?

 [2007-05-17 21:24 UTC] tiago dot tuxkiller at gmail dot com
My prefix is really different, sorry. But we need to use on this way.

If I don't say "/usr/lib64" the PHP will be compiled using "/usr/lib" (32bits)

This is my php.ini:
...
mysql.default_port = 3309
mysql.default_socket = /tmp/mysql4.sock
...

Thanks
 [2007-05-17 21:26 UTC] tiago dot tuxkiller at gmail dot com
Did you see this another bug?
http://bugs.php.net/bug.php?id=32081

It's like this, but it's closed (so I've opened one new).
But sound like tested only on PHP5...

[]s
 [2007-05-17 21:34 UTC] tony2001@php.net
You didn't answer this question:
What do you get with this after you finish 'make':
./sapi/cli/php -i | grep sock
?

Yes, I saw the other report and it's about MySQLi, which doesn't even exist in PHP4.
 [2007-05-17 21:53 UTC] tiago dot tuxkiller at gmail dot com
# /iG/php/php4+mysql4/source-4.4.7/sapi/cli/php -i | grep sock
Configure Command =>  './configure'
'--prefix=/data/php/php4+mysql4/bin-4.4.7'
'--with-freetype-dir=/usr/lib64' '--with-zlib'
'--with-jpeg-dir=/usr/lib64' '--with-gd'
'--with-mysql=/data/dbms/mysql4/bin'
'--with-mysql-sock=/tmp/mysql4.sock' '--with-ttf'
'--with-config-file-path=/data/php/php4+mysql4/bin-4.4.7'
'--with-apxs2=/data/http_servers/apache2+mysql4+php4+mod_auth/bin-2.2.4/
bin/apxs'
'--with-mime-magic=/data/http_servers/apache2+mysql4+php4+mod_auth/bin-2
.2.4/conf/magic'
MYSQL_SOCKET => /tmp/mysql.sock
mysql.default_socket => /tmp/mysql4.sock => /tmp/mysql4.sock
default_socket_timeout => 60 => 60


Please, note the MYSQL_SOCKET has different from mysql.default_socket.

Thanks
 [2007-05-17 22:01 UTC] tony2001@php.net
./sapi/cli/php -i | grep "php\.ini"
 [2007-05-17 22:05 UTC] tiago dot tuxkiller at gmail dot com
# /data/php/php4+mysql4/source-4.4.7/sapi/cli/php -i | grep "php\.ini"
Configuration File (php.ini) Path => /data/php/php4+mysql4/bin-4.4.7/php.ini

# grep ^mysql /data/php/php4+mysql4/bin-4.4.7/php.ini
mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port = 3309
mysql.default_socket = /tmp/mysql4.sock
mysql.default_host =
mysql.default_user =
mysql.default_password =
 [2007-05-17 22:11 UTC] tony2001@php.net
So you got this in your php.ini:
mysql.default_socket = /tmp/mysql4.sock

and your phpinfo() says this:
mysql.default_socket => /tmp/mysql4.sock => /tmp/mysql4.sock

What's your problem?
 [2007-05-17 22:13 UTC] tiago dot tuxkiller at gmail dot com
The problem is:

MYSQL_SOCKET => /tmp/mysql.sock

That's different from:
mysql.default_socket => /tmp/mysql4.sock => /tmp/mysql4.sock

Applications without "sock" configuration, was using /tmp/mysql.sock by default, and now /tmp/mysql4.sock.
 [2007-05-17 22:16 UTC] tony2001@php.net
>Applications without "sock" configuration, was using /tmp/mysql.sock
>by default, and now /tmp/mysql4.sock

They use mysql.default_socket when it's set.

And I repeat, I cannot reproduce anything like that, so I guess you've created the problem yourself using those wrong/invalid prefixes.
 [2007-05-17 23:40 UTC] tiago dot tuxkiller at gmail dot com
Ok, I've discovered.

The parameter "MYSQL_SOCKET" can be changed on compilation time of MySQL, and not PHP:

./configure \
"--prefix=/data/dbms/mysql4/bin-4.1.22" \
"--enable-thread-safe-client" \
"--with-pthread" \
"--with-unix-socket-path=/tmp/mysql4.sock" \
"--with-tcp-port=3309" \

After this, I just rebuild my PHP and all it's working now :)

Thanks
 [2007-05-18 11:55 UTC] tony2001@php.net
No bug -> bogus.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 15 10:01:27 2024 UTC