I compiled PHP with mysqlnd
using the prescriptions from Mysqlnd installation. PHP works fine. php -m | grep mysql
shows that neccessary MySQL modules are actually installed. Then I run php -S localhost:8088 -t <dir>.
In PHP code function_exists('mysqli_connect')
does return true
. But when I run mysqli_connect()
warning mysqli_connect(): (HY000/2002): No such file or directory
arises. In /etc/php.ini
I set default socket to /tmp/mysql.sock
then to /var/lib/mysql/mysql.sock
. Both variants didn't work. How can I enable mysql support in PHP-built-in server?
Asked
Active
Viewed 1,023 times
0

Bobby Foxx
- 15
- 3
1 Answers
0
Have you tried those solutions ? Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in
First try to use 127.0.0.1 instead of "localhost" in your mysqli_connect call.
Then make sure there is sockets where it should : make a symbolic link from /tmp/mysql.sock to /var/mysql/mysql.sock (or other way depending what exists on your computer)
Finally try to read all answers listed in the link above, maybe one of them will hel you
-
Thanx bar-code. I used your link. Then I went to other links mentioned there , and then to others, trying everything. And the one thing did miracle: I merely copied socket location from MySQL's config file to default sockets in `/etc/php.ini` – Bobby Foxx Nov 17 '15 at 09:03