chintansshah Posted September 28, 2010 Share Posted September 28, 2010 when I php file from command prompt, I get error"Fatal error: DB Error: extension not found", find code here. require_once(BASEDIR."/cfg/config.inc"); set_include_path(BASEDIR."/lib:" .BASEDIR."/lib/class:" . get_include_path()); require_once(BASEDIR."/lib/class/DB.php"); require_once(BASEDIR."/lib/class/DB/Query.php"); $_DB = DB::connect("mysql://" . $_CONFIG['DB']['username'] . (!empty($_CONFIG['DB']['password']) ? ":" . $_CONFIG['DB']['password'] : "") . "@" . (!empty($_CONFIG['DB']['server']) ? $_CONFIG['DB']['server'] : "localhost") . "/" . $_CONFIG['DB']['database'] , array('debug' => 2, 'portability' => DB_PORTABILITY_ALL)); if (PEAR::isError($_DB)) trigger_error($_DB->getMessage(), E_USER_ERROR); DB_Query::setDefaultConnection($_DB); Quote Link to comment https://forums.phpfreaks.com/topic/214607-fatal-error-db-error-extension-not-found/ Share on other sites More sharing options...
Bodhi Gump Posted October 18, 2010 Share Posted October 18, 2010 I assume it works from the browser? The php.ini for the browser may include the extension you need, but not the php.ini for the command line. Quote Link to comment https://forums.phpfreaks.com/topic/214607-fatal-error-db-error-extension-not-found/#findComment-1123577 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.