我正在尝试将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();
?>
它工作正常(显示“你好世界”)。
有人知道这是从哪里来的?
非常感谢。