我正试图在我们的web服务器上安装phpbugtracker。当我试图在安装屏幕上测试数据库连接时,我得到一个错误屏幕,上面写着“db test failure…数据库错误:找不到扩展名。正在从以下函数引发错误:
function test_database(&$params, $testonly = false) {
// PEAR::DB
define('PEAR_PATH', ''); // Set this to '/some/path/' to not use system-wide PEAR
// define('PEAR_PATH', 'inc/pear/'); // use a locally installed Pear (phpBT v0.9.1)
if (!@include_once(PEAR_PATH.'DB.php')) {
$error_message = translate("Failed loading Pear:DB");
$error_info = translate("Please check your Pear installation and the defined PEAR_PATH in install.php");
$error_info .= " <a href='http://pear.php.net/'>http://pear.php.net/</a>";
include('templates/default/install-dbfailure.html');
exit;
}
// execution gets this far without a problem...
$dsn = array(
'phptype' => $params['db_type'],
'hostspec' => $params['db_host'],
'database' => $params['db_database'],
'username' => $params['db_user'],
'password' => $params['db_pass']
);
$db = DB::Connect($dsn);
// Simple error checking on returned DB object to check connection to db
if (DB::isError($db)) {
// $db go boom...
$error_message = isset($db->message) ? $db->message : '';
$error_info = isset($db->user_info) ? $db->user_info : '';
include('templates/default/install-dbfailure.html');
exit;
} else {
if ($testonly) {
include('templates/default/install-dbsuccess.html');
exit;
} else {
return $db;
}
}
}
我使用的是mysql版本5.0.45,php版本4.47,pear::db版本1.7.6是稳定的。我已经验证了我可以连接到我正在使用的数据库和我创建的其他登录名。至于安装了哪些模块,我由我的托管公司决定。
有什么可能导致错误的想法吗?
编辑:db_type设置为“mysqli”。当我使用“mysql”作为类型时,我会得到一个“connection failed”错误。
最佳答案
好吧,我觉得有点傻,但是mysql的路径在这个特定的服务器上是不同的,我只是假设是本地主机。这与mysql和mysqli无关。固定的路径和它连接得很好。