could not find driver

浏览:6469 发布日期:2016/12/08 分类:ThinkPHP5专区 关键字: could not find driver ThinkPHP5 sqlsrv
我mac用MAMP一键配置了环境,但是现在需要连接远程sqlserver的数据库,修改database.php的type后提示这个错误,有大神知道怎么解决吗

[0] PDOException in Connection.php line 282
could not find driver

$this->resultSetType = $config['resultset_type'];
}
try {
if (empty($config['dsn'])) {
$config['dsn'] = $this->parseDsn($config);
}
if ($config['debug']) {
$startTime = microtime(true);
}
$this->links[$linkNum] = new PDO($config['dsn'], $config['username'], $config['password'], $params);
if ($config['debug']) {
// 记录数据库连接信息
Log::record('[ DB ] CONNECT:[ UseTime:' . number_format(microtime(true) - $startTime, 6) . 's ] ' . $config['dsn'], 'sql');
}
} catch (\PDOException $e) {
if ($autoConnection) {
Log::record($e->getMessage(), 'error');
return $this->connect($autoConnection, $linkNum);
} else {




[0] PDOException in Connection.php line 282
could not find driver

$this->resultSetType = $config['resultset_type'];
}
try {
if (empty($config['dsn'])) {
$config['dsn'] = $this->parseDsn($config);
}
if ($config['debug']) {
$startTime = microtime(true);
}
$this->links[$linkNum] = new PDO($config['dsn'], $config['username'], $config['password'], $params);
if ($config['debug']) {
// 记录数据库连接信息
Log::record('[ DB ] CONNECT:[ UseTime:' . number_format(microtime(true) - $startTime, 6) . 's ] ' . $config['dsn'], 'sql');
}
} catch (\PDOException $e) {
if ($autoConnection) {
Log::record($e->getMessage(), 'error');
return $this->connect($autoConnection, $linkNum);
} else {

最佳答案
评论( 相关
后面还有条评论,点击查看>>