我刚刚在一台在线服务器上传了我的symfony项目,但它给了我这个错误:
首先我认为我应该安装pdo_mysql
扩展的问题,但我发现它已经安装在服务器上了:
我该怎么办?
编辑:
public static function getConnection(
array $params,
Configuration $config = null,
EventManager $eventManager = null)
{
// create default config and event manager, if not set
if ( ! $config) {
$config = new Configuration();
}
if ( ! $eventManager) {
$eventManager = new EventManager();
}
$params = self::parseDatabaseUrl($params);
// check for existing pdo object
if (isset($params['pdo']) && ! $params['pdo'] instanceof \PDO) {
throw DBALException::invalidPdoInstance();
} elseif (isset($params['pdo'])) {
$params['pdo']->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$params['driver'] = 'pdo_' . $params['pdo']->getAttribute(\PDO::ATTR_DRIVER_NAME);
} else {
self::_checkParams($params);
}
if (isset($params['driverClass'])) {
$className = $params['driverClass'];
} else {
$className = self::$_driverMap[$params['driver']];
}
$driver = new $className();
$wrapperClass = 'Doctrine\DBAL\Connection';
if (isset($params['wrapperClass'])) {
if (is_subclass_of($params['wrapperClass'], $wrapperClass)) {
$wrapperClass = $params['wrapperClass'];
} else {
throw DBALException::invalidWrapperClass($params['wrapperClass']);
}
}
//line 173
return new $wrapperClass($params, $driver, $config, $eventManager);
}
提前致谢。