Codeigniter错误:调用未定义函数mysql_pconnect() [英] Codeigniter error: Call to undefined function mysql_pconnect()
本文介绍了Codeigniter错误:调用未定义函数mysql_pconnect()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已将我的codeigniter版本从2.2.4逐步更新到3.0.6,但出现错误:
I have updated my codeigniter version from 2.2.4 step by step to 3.0.6 and I get an error:
An uncaught Exception was encountered
Type: Error
Message: Call to undefined function mysql_pconnect()
Filename: path-to-project\system\database\drivers\mysql\mysql_driver.php
Line Number: 135
Backtrace:
File: path-to-project\application\controllers\Main.php
Line: 10
Function: __construct
File: path-to-project\index.php
Line: 315
Function: require_once
我刚刚用新的目录替换了index.php文件和系统目录,并根据教程对应用程序进行了一些更改.
I have just replaced my index.php file and system directory with the new one and made some changes in my application according to tutorial.
这是主控制器:
class Main extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->model('main_model');
}
}
是什么原因引起的?!
推荐答案
感谢 Anant
我得出一个结论:
我用新的文件完全更改了config文件夹中的旧database.php文件:
I completely changed my old database.php file in config folder with the new one:
发件人:
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = '';
$db['default']['password'] = '';
$db['default']['database'] = '';
$db['default']['dbdriver'] = '';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
收件人:
$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
);
错误消失了!
这篇关于Codeigniter错误:调用未定义函数mysql_pconnect()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文