Mehran
Mehran

Reputation: 16861

Change PHP CLI's MYSQL_SOCKET configuration

Consider the following PHP CLI configuration directives:

mysql.default_socket
mysqli.default_socket
pdo_mysql.default_socket

What's their relation with these two:

MYSQL_SOCKET
MYSQLI_SOCKET

And how can I set the later ones? I can easily set the first three, in php.ini, to point to the correct address but it seems that it's the second two which are effective.

BTW, I'm using PHP 5.3 with php_mysql, php_mysqli and pdo_mysql.

Upvotes: 1

Views: 1759

Answers (2)

Leon Boot
Leon Boot

Reputation: 136

I ran into this issue just now and all I could find was this thread (and a dozen sites who ripped this thread off SO). I ended up recompiling PHP with the --with-mysql-sock=/path/to/mysql.sock option. It worked, but it's not going to be a real solution to anyone not able to recompile PHP.

Upvotes: 1

diolemo
diolemo

Reputation: 2671

Ensure that the CLI version is reading the correct configuration file.

php -c <config-file-path> <php-file>

Upvotes: 0

Related Questions