Codeigniter error: Call to undefined function mysql_pconnect()

call to undefined function mysql_connect() php 7
fatal error uncaught error: call to undefined function log_message
call to undefined function mysql_connect adodb
fatal error: uncaught error: call to undefined function mysql_query
call to undefined function mysqli_pconnect()
call to undefined function mysql_connect centos 7
message call to undefined function mysqli_init linux
call to undefined function mysql_connect please install the mysql connector for php

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

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.


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'; 

error, fOr remove Codeigniter error: Call to undefined function mysql_pconnect() or If you are using php 7 version the in Codeigniter will not run mysql you must need  fOr remove Codeigniter error: Call to undefined function mysql_pconnect() or If you are using php 7 version the in Codeigniter will not run mysql you must need use pdo or mysqli setp for CodeIgniter mysqli in your project


Thanks to Anant

I come to a conclusion:

I completely changed my old database.php file in config folder with the new one:

From:

$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;

To:

$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
);

And the error is gone!

PHP Fatal error: Call to undefined function mysql_pconnect() in , It says Call to undefined function mysql_pconnect(). `mysql` functions are deprecated since PHP 5.5 and removed on PHP7. You should not use them. Please use `mysqli` functions or PDO. It says Call to undefined function mysql_pconnect(). `mysql` functions are deprecated since PHP 5.5 and removed on PHP7. You should not use them. Please use `mysqli` functions or PDO.


If this error happened when you're hosting the website, make sure to set the correct PHP Version (the one your CI use).

Uncaught Error:Call to undefined function mysql_pconnect() in , Recommendation. I would recommend you use mysqli ( http://php.net/manual/en/​book.mysqli.php ) which is an improved version of mysql. Quick Fix. Full Details  I have the class for resetting a user password. But the code is always gives me an error: Fatal error: Call to undefined function newRandomPwd() in C:\AppServ\www\phonebook\application\controllers\reset.php on line 32 Here is my code:


Fatal error Uncaught Error Call to undefined function mysql , Uncaught Error:Call to undefined function mysql_pconnect() in.CI_DB_driver ci_autoloader Duration: 1:49 Posted: Apr 15, 2017 [Solved]Fatal error: Call to undefined function base_url() in Codeigniter php, message call to undefined function base_url() codeigniter, base_url() not working in Codeigniter


Fatal error: Uncaught Error: Call to undefined function mysql_pconnect, again later. Published on Nov 16, 2018. fix codeigniter error : Fatal error: Uncaught Error Duration: 0:59 Posted: Nov 16, 2018 This problem appears because the MySQL module is not active into your PHP installation or because the MySQL module was not compiled with permanent connections support. In the first case you should check that the php_mysql module is enabled into the php.ini file and if not, uncomment the line which enable this module.


Uncaught Error: Call to undefined function mysql_connect() · Issue , Fatal error: Uncaught Error: Call to undefined function mysql_pconnect() in /​hms/system/core/CodeIgniter.php(308): Login->__construct() #8  carousel Fatal error: Call to undefined function: imagecreatefromjpeg() in is there anyone can help my proble Thank you very much and may ur God Bless You! Pages (7119): « Previous 1 …