我正在尝试在我们的网络服务器上安装 phpBugTracker。当我尝试在安装屏幕上测试数据库连接时,我收到一个错误屏幕,显示“DB Test Failure... DB Error: extension not found”。错误是从以下函数引发的:
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”作为类型时,我得到一个“连接失败”错误。