PEAR :: DB error, extension not found

I am trying to install phpBugTracker on our web server. When I try to check the database connection on the installation screen, I get an error screen that reads "DB testing error ... DB error: extension not found". The error is called from the following function:

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;
        }
    }
}

I am using MySQL version 5.0.45, PHP version 4.47, and I have a stable version of PEAR :: DB version 1.7.6. I have already verified that I can connect to the database that I am using with the name that I created otherwise. I am at the mercy of my hosting company regarding which modules are installed.

Any ideas on what might cause the error?

: db_type "mysqli". "mysql" , "connection failed".

+3
2

, , MySQL , localhost. mysql vs. mysqli. , .

+1

phpinfo(), db_type, , . , mysqli "db_type, " mysql " ( 'i')?

MySQL i PHP4.

+2

Source: https://habr.com/ru/post/1705116/


All Articles