Problem:
While upgrading the Codeigniter version from 2 to 3, there is error with the database configuration:
An uncaught Exception was encountered
Type: Error
Message: Call to undefined function mysql_pconnect()
The main resson of getting this error is that mysql_*
is deprecated so you will have to switch eaither to mysqli_*
or PDO
TO fix this issue you will have to change the database drive setting in config/database.php
from mysql to mysqli or pdo
$db['default']['dbdriver'] = 'mysqli';
In addition to this I would suggest you to change your database configuration file to match with latest syntax/settings of Codeigniter
Here is the old one:
Solution:
Replace it with the following and you should be good to go:
Also in addition to this if the error is still exists, then make sure you are using the correct PHP version on your server.
Further more make sure that the PDO or the MySQLi extension is enabled and ready to use.