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-projectsystemdatabasedriversmysqlmysql_driver.php
Line Number: 135
Backtrace:
File: path-to-projectapplicationcontrollersMain.php
Line: 10
Function: __construct
File: path-to-projectindex.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');
}
}
导致问题的原因是什么?!
What causes the problem?!
还有这是教程的链接.
推荐答案
感谢 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屋!
查看全文