With this tutorial you will learn how to deal with ‘Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future’ error after Opencart 1.5.x theme installation.
We strongly recommend that you backup the files before editing!
In order to resolve this issue you need to change three things:
Download this archive.
Find the config.php file, located in the root directory of your OpenCart installation.
Find the config.php file, located in the admin folder.
If you have the built-in code editor on your cPanel, feel free to use it.
After you have downloaded archive mentioned in the first step you need to extract the files from it. You can check these links to learn how to do it for Windows and Mac. After you have done so, please, upload all the content of the Uploads folder to your OpenCart root folder.
Now, when the files has been transferred, you need to go to your cPanel/FTP and locate the config.php file. Download it to your computer and edit it with any code editor convenient (Notepad++, Sublime, Adobe Dreamweaver).
Locate the approximately 21st line define(‘DB_DRIVER’, ‘mysql’); and change it to the following: define(‘DB_DRIVER’, ‘mysqliz’);. Save the changes and upload it back to the root directory, make sure to overwrite the existing config.php file.
Then you will need to perform same procedure in the config.php file in the admin folder. Please, go to admin folder and download config.php file. Open it with the same code editor you edited the previous file and locate approximately 24th define(‘DB_DRIVER’, ‘mysql’);. Then change it so it looks like this: define(‘DB_DRIVER’, ‘mysqliz’);. Save the changes and upload the file to the admin folder and make sure the existing file is replaced.
After the file modifications are completed, please, clear the browsers cache. You will see that your site is working properly now.
Feel free to check the detailed video tutorial below:
Also, take a look at the collection of our premium OpenCart templates.