PEAR :: DB错误,未找到扩展名(PEAR::DB Error, Extension Not Found)

编程入门 行业动态 更新时间:2024-10-17 17:16:30
PEAR :: DB错误,未找到扩展名(PEAR::DB Error, Extension Not Found)

我试图在我们的Web服务器上安装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”作为类型时,我得到“连接失败”错误。

I am attempting to install phpBugTracker on our web server. When I attempt to test the database connection on the installation screen, I get an error screen that reads "DB Test Failure... DB Error: extension not found". The error is being thrown 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 PEAR::DB version 1.7.6 stable. I've already verified that I can connect to the database I'm using with the login I've created otherwise. I am at the mercy of my hosting company as to what modules are installed.

Any ideas on what could be causing the error?

Edit: db_type is set to "mysqli". When I use "mysql" as the type I get a "connection failed" error instead.

最满意答案

使用phpinfo()验证是否已安装并激活了您正在使用的db_type扩展。 也许你正在尝试使用“ mysqli ” db_type ,而你应该使用“ mysql(没有'i')

MySQL 没有默认使用PHP4。

Okay, I feel rather silly, but the path to MySQL was different on this particular server and I had just assumed localhost. This had nothing to do mysql vs. mysqli. Fixed path and it connected just fine.

更多推荐

本文发布于:2023-08-05 04:11:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1428124.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:扩展名   未找到   错误   DB   PEAR

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!