I have a minimal OpenBSD 5.7 amd64 install in VMware where I have installed matching versions of PHP and PHP-FPM, plus nginx, and mariadb using pkg_add
. I configure all the services, and get nginx to parse HTML through PHP-FPM, and everything is fine, until I try to connect to MariaDB. It does not connect to MySQL/MariaDB. I have tried three different PHP CMSes using correct credentials, and each gives the following error:
Warning: mysql_connect(): Can't connect to local MySQL server through socket Warning: mysql_connect(): Can't connect to local MySQL server through socket /var/run/mysql/mysql.sock (62 "Too many levels of symbolic links") in /htdocs/index.php on line 5
This is after doing ths
mkdir -p /var/www/var/run/
ln -s /var/run/mysql /var/www/var/run/mysql
What in the world is the problem here? I have tried four different tutorials, and I just simply cannot get PHP and MySQL to work with each other. Even though I am certain MySQL is running, and I can use mysql -p -u ...
to connect just fine to the server.
Please help.
EDIT:
# ls -al /var/run/mysql /var/www/var/run/mysql
lrwxr-xr-x 1 root daemon 14 May 5 11:07 /var/www/var/run/mysql -> /var/run/mysql
/var/run/mysql:
total 8
drwx--x--x 2 _mysql _mysql 512 May 5 11:01 .
drwxr-xr-x 4 root wheel 512 May 5 11:06 ..
srwxrwxrwx 1 _mysql _mysql 0 May 5 11:01 mysql.sock
#