【发布时间】:2009-12-16 16:50:24
【问题描述】:
我正在尝试将 symfony 项目放在客户端服务器上进行生产。 该网站在我们公司的服务器上运行良好,但现在出现此错误:
500 | Internal Server Error | Doctrine_Connection_Exception
PDO Connection Error: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
这里是database.yml:
all:
doctrine:
class: sfDoctrineDatabase
param:
dsn: 'mysql:host=localhost;dbname=24DLJLRR1'
username: xxxxxxxxxx
password: xxxxxxxxxx
此外,如果我尝试测试 mysql_connect :
<?php
mysql_connect("localhost", "xxxxxxxxxx", "xxxxxxxxxx");
mysql_select_db("24DLJLRR1");
$answer = mysql_query("SELECT * FROM video_games") or die(mysql_error());
echo 'hello world'
mysql_close();
?>
它工作正常(它显示“hello world”)。 有人知道这是哪里来的吗?
非常感谢。
【问题讨论】:
标签: php mysql symfony1 doctrine