I'm just setting up my new pc - I downloaded the latest Xampp (1.8.3), downloaded the latest OC (1.5.6) and then set up a shop. However, I keep getting error messages: "Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in (...) \system\database\mysql.php on line 6"
Sometimes I get a popup window with a whole long list of variables which it is apparently having trouble with.
What can I do?
Sometimes I get a popup window with a whole long list of variables which it is apparently having trouble with.
What can I do?
Last edited by jillc on Mon Sep 16, 2013 6:01 pm, edited 1 time in total.
Download the mysqli database driver at:
https://raw.github.com/opencart/opencar ... mysqli.php
Upload it to your site then your config files to use mysqli.
https://raw.github.com/opencart/opencar ... mysqli.php
Upload it to your site then your config files to use mysqli.
-Ryan
put the database driver there:
and edit config.php (in root directory)
Code: Select all
system/database/mmysqli.php
Code: Select all
define('DB_DRIVER', 'mmysqli');
Mass update product descriptions/Hromadná změna popisků zboží
I followed CZechBoY instructions with file indicated by rph (the second one) and its working great. I also changed 'DB_DRIVER' line in config.php inside admin dir to eliminate the warnig message on the administrative pages.
However, with the mysqli driver I'm having problems with some characters displayed on the pages. I'm investigating how to fix it.
However, with the mysqli driver I'm having problems with some characters displayed on the pages. I'm investigating how to fix it.
Adding the following line after $this->mysqli->set_charset('utf-8'); in mmysqli.php fixed my problem with foreign characters being displayed as question marks:
$this->mysqli->query("SET NAMES 'utf8'");
PHP manual (http://php.net/manual/en/mysqli.set-charset.php) has the following note:
"This is the preferred way to change the charset. Using mysqli_query() to set it (such as SET NAMES utf8) is not recommended. See the MySQL character set concepts section for more information."
However, I couldn't find other way to make it work.
$this->mysqli->query("SET NAMES 'utf8'");
PHP manual (http://php.net/manual/en/mysqli.set-charset.php) has the following note:
"This is the preferred way to change the charset. Using mysqli_query() to set it (such as SET NAMES utf8) is not recommended. See the MySQL character set concepts section for more information."
However, I couldn't find other way to make it work.
Can I reopen this?
I am having a very similar issue. The solution above worked to an extent but I am still seeing an error relating to the vqcache:
Fatal error: Class 'DBmysqliz' not found in /home/*/public_html/shop/vqmod/vqcache/vq2-system_library_db.php on line 13
or Fatal error: Class 'mmysqli' not found in /home/*/public_html/shop/vqmod/vqcache/vq2-system_library_db.php on line 13
I have tried deleting all from the cache, but no cigar!
Short of installing a fresh store, I am short of answers of what to do?
Can someone please help?
This problem is because I changed my host - of which have a more recent php 5.5 version.
I am having a very similar issue. The solution above worked to an extent but I am still seeing an error relating to the vqcache:
Fatal error: Class 'DBmysqliz' not found in /home/*/public_html/shop/vqmod/vqcache/vq2-system_library_db.php on line 13
or Fatal error: Class 'mmysqli' not found in /home/*/public_html/shop/vqmod/vqcache/vq2-system_library_db.php on line 13
I have tried deleting all from the cache, but no cigar!
Short of installing a fresh store, I am short of answers of what to do?
Can someone please help?
This problem is because I changed my host - of which have a more recent php 5.5 version.
@sugarskull
newer versions of OpenCart already contain the MySQLi driver.
simply edit config.php:
you should stop seeing errors.
cheers
-Lyle H.
newer versions of OpenCart already contain the MySQLi driver.
simply edit config.php:
Code: Select all
define('DB_DRIVER', 'mysqli');
cheers
-Lyle H.
Hello, sorry for bumping an old thread but I need to know couple of things regarding mysqli deprecation error, all on one place:uhhmnet wrote:@sugarskull
newer versions of OpenCart already contain the MySQLi driver.
simply edit config.php:you should stop seeing errors.Code: Select all
define('DB_DRIVER', 'mysqli');
cheers
-Lyle H.
- Which version of Opencart was the first to support the mysqli driver? Is 1.5.5.1 supporting it correctly?
- If I use Opencart version that supports it, is the only step necessary to edit the config.php? No adding other lines of code mentioned in this thread?
- If I do a clean install of a newer Opencart version that supports the mysqli driver by default when clean installed, and then import a backup of my old 1.5.5.1 Opencart database that used the old mysql extension, will there be incompatibilities in database tables?
- What does actually enabling mysqli driver affect/alters in Opencart installation code? The Opencart code, the mysql database tables' code or both?
Just read here, that's all it takes!putinhk wrote:Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDOAnyone has more CLEARLY solutions?
i.e where to download/upgrade and config
http://forum.opencart.com/viewtopic.php ... 80#p572236
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
I tried that but no luckIP_CAM wrote:Just read here, that's all it takes!
http://forum.opencart.com/viewtopic.php ... 80#p572236
Ernie
For anyone else following after me the issue in my case was that my PHP version had been upgraded and the old OC store couldn't work with it.
I set the PHP version to a previous one and the errors etc. disappeared
I set the PHP version to a previous one and the errors etc. disappeared
Hello.
Why use old PHP if you can use latest with all features?
You can solve your mysql_connect() problem with this extension:
http://www.opencart.com/index.php?route ... n_id=23099
Why use old PHP if you can use latest with all features?
You can solve your mysql_connect() problem with this extension:
http://www.opencart.com/index.php?route ... n_id=23099
Izdelava spletne trgovine | Najem spletne trgovine | PHP programiranje
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Download the file from the following link:
https://raw.githubusercontent.com/openc ... mysqli.php
Then UPLOAD the file into the following directory:
/public_html/system/database
Then MODIFY the config.php file at the following directory:
First directory: /public_html
Second directory: /public_html/admin
In both directories look for the following:
define('DB_DRIVER', 'mysqli');
Chang only the underline mysqli to become mmysqli
the final looks will be as following:
define('DB_DRIVER', 'mmysqli');
Save the changes in both directories.
That is it Engoy!!
https://raw.githubusercontent.com/openc ... mysqli.php
Then UPLOAD the file into the following directory:
/public_html/system/database
Then MODIFY the config.php file at the following directory:
First directory: /public_html
Second directory: /public_html/admin
In both directories look for the following:
define('DB_DRIVER', 'mysqli');
Chang only the underline mysqli to become mmysqli
the final looks will be as following:
define('DB_DRIVER', 'mmysqli');
Save the changes in both directories.
That is it Engoy!!
solved my problem and help support very good, recommended, thank you very much.
faca5 wrote:Hello.
Why use old PHP if you can use latest with all features?
You can solve your mysql_connect() problem with this extension:
http://www.opencart.com/index.php?route ... n_id=23099
There is a lot of conflicting recommendations here.
http://forum.opencart.com/viewtopic.php?f=20&t=133437
http://forum.opencart.com/viewtopic.php ... 6&p=530799
http://forum.opencart.com/viewtopic.php?f=181&t=151859
Some of the hosting services are now phasing out php 5.4 and forcing upgrades to 5.5 and 5.6.
I'm running an older version pre 1.5.6 and I can't get it to work with either php 5.5 or 5.6.
I tried changing define('DB_DRIVER', 'mysql'); to mysqli but there is an error because there is an extra bracket in the code "}". I read that the mysqli.php is not functional in older versions of opencart.
The mysqli.php file is identical from 1.5.5.1 through 1.5.6.3, with the same extra bracket "}".
However it looks very different on 1.5.6.4.
I also checked the version on Github, but it also looks very different from the version in 1.5.6.4. But it appears to be for 2.x? Will it work with pre 1.5.6?
https://github.com/opencart/opencart/bl ... mysqli.php
I also looked at the mysqliz extension, which also looks very different from all the others. Is this safe to use?
http://www.opencart.com/index.php?route ... n_id=13041
Which of these 3 versions of mysqli.php is best to use for pre-1.5.6?
The version in 1.5.6.4
The version from Github
The version in the mysqliz extension
I also get an error in my older version of vqmod when I attempt to switch to php 5.5 or 5.6:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in vqmod/vqmod.php ...
I read here to change the problematic line in the vqmod.php to:
$modFilePath = preg_replace_callback('/([^*]+)/', function ($m) { return preg_quote($m[1], "~"); }, $modFilePath);
http://forum.opencart.com/viewtopic.php?f=22&t=130679
If I decide to upgrade vqmod to the latest version using the "install" method, will I encounter additional problems, or is it safer to simply change this one line with the preg_replace_callback?
http://forum.opencart.com/viewtopic.php?f=20&t=133437
http://forum.opencart.com/viewtopic.php ... 6&p=530799
http://forum.opencart.com/viewtopic.php?f=181&t=151859
Some of the hosting services are now phasing out php 5.4 and forcing upgrades to 5.5 and 5.6.
I'm running an older version pre 1.5.6 and I can't get it to work with either php 5.5 or 5.6.
I tried changing define('DB_DRIVER', 'mysql'); to mysqli but there is an error because there is an extra bracket in the code "}". I read that the mysqli.php is not functional in older versions of opencart.
The mysqli.php file is identical from 1.5.5.1 through 1.5.6.3, with the same extra bracket "}".
However it looks very different on 1.5.6.4.
I also checked the version on Github, but it also looks very different from the version in 1.5.6.4. But it appears to be for 2.x? Will it work with pre 1.5.6?
https://github.com/opencart/opencart/bl ... mysqli.php
I also looked at the mysqliz extension, which also looks very different from all the others. Is this safe to use?
http://www.opencart.com/index.php?route ... n_id=13041
Which of these 3 versions of mysqli.php is best to use for pre-1.5.6?
The version in 1.5.6.4
The version from Github
The version in the mysqliz extension
I also get an error in my older version of vqmod when I attempt to switch to php 5.5 or 5.6:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in vqmod/vqmod.php ...
I read here to change the problematic line in the vqmod.php to:
$modFilePath = preg_replace_callback('/([^*]+)/', function ($m) { return preg_quote($m[1], "~"); }, $modFilePath);
http://forum.opencart.com/viewtopic.php?f=22&t=130679
If I decide to upgrade vqmod to the latest version using the "install" method, will I encounter additional problems, or is it safer to simply change this one line with the preg_replace_callback?
Who is online
Users browsing this forum: No registered users and 49 guests