Page 1 of 1

Frustrating error: extension not found

Posted: Mon Aug 15, 2005 3:39 pm
by aj574
I have a script that connects to a database using PEAR::DB for database abstraction. Here is the relevent part of the script:

Code: Select all

require_once('DB.php');

$db_engine = 'mysqli';
$db_user = '****';
$db_pass = '****';
$db_host = 'localhost';
$db_name = '****';

$datasource = $db_engine.'://'.
			  $db_user.':'.
			  $db_pass.'@'.
		 	  $db_host.'/'.
	  		  $db_name;

$db = DB::connect($datasource);
if (PEAR::isError($db)) {
    die($db->getMessage());
}
When I run this, I get the following error message:

DB Error: extension not found

I'm not quite sure which extension isn't being found correctly. I have the mysql extension enabled (and the dll is in the proper directory) in php.ini, and there are no errors about DB.php not being found. I'm stumped, can anyone help?

EDIT: I forgot to say, the ****'s all hold the proper values, and the database is indeed on the localhost. I'm using MySQL 4.1 and PHP 5 on Windows 2000 Professional with Apache 2.0.

Posted: Mon Aug 15, 2005 3:45 pm
by feyd
did you try setting the debug option? Maybe your version doesn't support mysqli, or doesn't have the mysqli class installed?

Posted: Mon Aug 15, 2005 3:48 pm
by timvw
my guess is that the op has (only) loaded the mysql extension. And he's asking pear::db to use the mysqli functions..

So, either load mysqli extension or change db_engine to mysql

Posted: Mon Aug 15, 2005 3:51 pm
by aj574
When $db_engine is changed to mysql, I get the same error. I'll try setting the debug option and see what I get. Thank you for your help so far.

Posted: Mon Aug 15, 2005 3:57 pm
by aj574
Do you mean setting the debug option DB::Connect, like so?

Code: Select all

$options = array(
    'debug'       => 2,
);

$db = DB::connect($datasource, $options);
if (PEAR::isError($db)) {
    die($db->getMessage());
}
I get the same error message no matter what value I set.