Strato服务器PHP Zend异常套接字
我正在尝试通过Zend使用PDO连接连接到数据库:Strato服务器PHP Zend异常套接字,php,mysql,zend-framework,pdo,Php,Mysql,Zend Framework,Pdo,我正在尝试通过Zend使用PDO连接连接到数据库: <?php class Feuerwehr_Db extends Zend_Db { public static function factoryEinsaetze(){ $config = array( 'LOCAL' => array( 'servername' => "localhost", 'usernam
<?php
class Feuerwehr_Db extends Zend_Db {
public static function factoryEinsaetze(){
$config = array(
'LOCAL' => array(
'servername' => "localhost",
'username' => "root",
'password' => "admin",
'dbname' => "einsaetze"
),
'LIVE' => array(
'servername' => "rdbms.strato.de",
'username' => "U2340080",
'password' => "*****",
'dbname' => "DB2340080"
)
);
return parent::factory('Pdo_Mysql', $config[Feuerwehr_Environment::getStage()]);
}
}
服务器上的PHP版本是5.6,标准的mysql_connect工作得很好。Zend希望密钥是“主机”而不是“服务器名”。默认参数设置为localhost,用于解释错误异常
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)' in /mnt/web024/d1/57/5707957/htdocs/Beta/library/Zend/Db/Adapter/Pdo/Abstract.php:129 Stack trace: #0 /mnt/web024/d1/57/5707957/htdocs/Beta/library/Zend/Db/Adapter/Pdo/Abstract.php(129): PDO->__construct('mysql:servernam...', 'U2340080', '*****', Array) #1.....