当前位置: 首页 > 知识库问答 >
问题:

致命错误:未捕获错误:调用/homepages/[duplicate]中未定义的函数mysql\u pconnect()

越姚石
2023-03-14

我正在尝试安装我的页面,但此错误是:

Fatal error: Uncaught Error: Call to undefined function mysql_pconnect() in /homepages/14/db1/htdocs/bonoboapp/system/database/drivers/mysql/mysql_driver.php:91 
Stack trace: #0 /homepages/14/db1/htdocs/bonoboapp/system/database/DB_driver.php(115): CI_DB_mysql_driver->db_pconnect() 
#1 /homepages/14/db1/htdocs/bonoboapp/system/database/DB.php(148): CI_DB_driver->initialize() 
#2 /homepages/14/db1/htdocs/bonoboapp/carpooling/core/MY_Router.php(111): DB() 
#3 /homepages/14/db1/htdocs/bonoboapp/carpooling/core/MY_Router.php(68): My_Router->_get_db_route('login') 
#4 /homepages/14/db1/htdocs/bonoboapp/system/core/Router.php(170): My_Router->_parse_routes() 
#5 /homepages/14/db1/htdocs/bonoboapp/system/core/CodeIgniter.php(173): CI_Router->_set_routing() 
#6 /homepages/14/db1/htdocs/bonoboapp/index.php(213): require_once('/homepages/14/d...') 
#7 {main} thrown in /homepages/14/db1/htdocs/bonoboapp/system/database/drivers/mysql/mysql_driver.php on line 91

你能帮我吗。

共有1个答案

尹昀
2023-03-14

我想你正在使用Codeigniter,这个错误很可能是使用了他们的数据库类和驱动程序,所以你没有直接使用PHP的MySQL函数

因此,你所需要做的就是改变

$db['default']['dbdriver'] = 'mysql';

$db['default']['dbdriver'] = 'mysqli';

为database.php文件添加以下设置

$db['default'] = array(
'dsn'   => '',
'hostname' => '',
'username' => '',
'password' => '',
'database' => '',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
 类似资料: