Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
423 views
in Technique[技术] by (71.8m points)

php - Codeigniter error: Call to undefined function mysql_pconnect()

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

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.

and this is the Main controller:

class Main extends CI_Controller {

    function __construct()
    {
        parent::__construct();
        $this->load->model('main_model');
    }
}

What causes the problem?!

And this is the link of the tutorial.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Deprecated features in PHP 5.5.x:

The original MySQL extension is now deprecated, and will generate E_DEPRECATED errors when connecting to a database. Instead, use the MySQLi or PDO_MySQL extensions.

You're using the deprecated 'mysql' dbdriver. Locate the config/database.php file and change dbdriver to use 'mysqli' :

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...