fcgi pdo_mysql connect problem
| From: | Antti Holvikari | Date: | Wed, 01 Nov 2006 20:46:55 +0000 |
| Subject: | fcgi pdo_mysql connect problem | ||
| Groups: | php.install | ||
| Request: | Send a blank email to php-install+get-17722@lists.php.net to get a copy of this message | ||
Hi!
I installed lighttpd, fastcgi and php 5.2RC6. I can't get the fastcgi
php to connect to mysql with pdo. If I run
php -r "new PDO('mysql:unix_socket=/opt/local/var/run/mysql5/mysqld.sock;dbname=dbname',
'root', '');"
..it works. But when I try to connect to mysql with fcgi (hitting my
script with browser) I get a:
Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[HY000] [2002] Can't connect to local MySQL server through
socket '/opt/local/var/run/mysql5/mysqld.sock' (13)'
I can also connect with:
mysql5 --socket=/opt/local/var/run/mysql5/mysqld.sock -u root...from the command line. I'm pulling my hear with this. Do you have any clues what could be wrong? -- Antti Holvikari <http://phphalo.com>