[英]integrate codeigniter website from live to local server
I try to integrate codeigniter website from live to local server 我尝试将Codeigniter网站从实时服务器集成到本地服务器
but have this error A PHP Error was encountered Severity: 8192 但是有此错误遇到PHP错误严重性:8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP;
消息:与类相同名称的方法在将来的PHP版本中将不再是构造函数; CI_Session has a deprecated constructor
CI_Session具有不推荐使用的构造函数
Filename: libraries/Session.php
文件名:libraries / Session.php
Line Number: 12
行号:12
Fatal error: Uncaught Error: Call to undefined function mysql_pconnect() in C:\\xampp\\htdocs\\makan\\system\\database\\drivers\\mysql\\mysql_driver.php:91 Stack trace: #0 C:\\xampp\\htdocs\\makan\\system\\database\\DB_driver.php(115): CI_DB_mysql_driver->db_pconnect() #1 C:\\xampp\\htdocs\\makan\\system\\database\\DB.php(148): CI_DB_driver->initialize() #2 C:\\xampp\\htdocs\\makan\\system\\core\\Loader.php(346): DB(Array, NULL) #3 C:\\xampp\\htdocs\\makan\\application\\core\\MY_Controller.php(29): CI_Loader->database() #4 C:\\xampp\\htdocs\\makan\\application\\controllers\\site\\landing.php(7): MY_Controller->__construct() #5 C:\\xampp\\htdocs\\makan\\system\\core\\CodeIgniter.php(308): Landing->__construct() #6 C:\\xampp\\htdocs\\makan\\index.php(202): require_once('C:\\xampp\\htdocs...') #7 {main} thrown in C:\\xampp\\htdocs\\makan\\system\\database\\drivers\\mysql\\mysql_driver.php on line 91
致命错误:未捕获错误:调用C:\\ xampp \\ htdocs \\ makan \\ system \\ database \\ drivers \\ mysql \\ mysql_driver.php:91中未定义的函数mysql_pconnect()堆栈跟踪:#0 C:\\ xampp \\ htdocs \\ makan \\ system \\ database \\ DB_driver.php(115):CI_DB_mysql_driver-> db_pconnect()#1 C:\\ xampp \\ htdocs \\ makan \\ system \\ database \\ DB.php(148):CI_DB_driver-> initialize()#2 C:\\ xampp \\ htdocs \\ makan \\ system \\ core \\ Loader.php(346):DB(Array,NULL)#3 C:\\ xampp \\ htdocs \\ makan \\ application \\ core \\ MY_Controller.php(29):CI_Loader-> database( )#4 C:\\ xampp \\ htdocs \\ makan \\ application \\ controllers \\ site \\ landing.php(7):MY_Controller-> __ construct()#5 C:\\ xampp \\ htdocs \\ makan \\ system \\ core \\ CodeIgniter.php( 308):着陆-> __ construct()#6 C:\\ xampp \\ htdocs \\ makan \\ index.php(202):require_once('C:\\ xampp \\ htdocs ...')#7 {main}抛出C:第91行的\\ xampp \\ htdocs \\ makan \\ system \\ database \\ drivers \\ mysql \\ mysql_driver.php
mysql_
has been deprecated since PHP 5, and entirely removed as of PHP 7. You should not be using that driver. 自PHP 5起,
mysql_
已被弃用,自PHP 7起已完全删除。您不应该使用该驱动程序。
Instead, have a look at either PHP MySQLi or PHP PDO 相反,请查看PHP MySQLi或PHP PDO
Find your database config file, and change the driver to: 找到您的数据库配置文件,并将驱动程序更改为:
$db['default']['dbdriver'] = 'mysqli';
Your config may also look like: 您的配置也可能如下所示:
$db['mysql'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'YOUR_USERNAME',
'password' => 'YOUR_PASSWORD',
'database' => 'DATABASE_NAME',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.