fcgi pdo_mysql connect problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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>

[Index of Archives]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [Postgresql]     [PHP Books]     [PHP Databases]     [PHP SOAP]
  Powered by Linux