Hi
Opencart version:- 1.5.6
I'd appreciate some help please.
Yesterday both my website and admin showed an error message
'Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead.....'
I search the forum and found it it might be an upgrade to PHP 5 that caused it.
I've edited BOTH the config.php and the admin/config.php files and change the db driver FROM mysql to mysqli.
However now I have this error on website and admin page
Parse error: syntax error, unexpected 'else' (T_ELSE), expecting function (T_FUNCTION) in /home/dagg00/public_html/system/database/mysqli.php on line 54
Many Thanks,
Amanda
The solution (and bug) is typically OpenCart: from his posting I assume that he is using 1.5.6 (0).
And with that version this file is simply shit because not ready to use!
@daggart: download a later published pversion, e.g. 1.5.6.1 or better and replace the old file with the new.
And with that version this file
Code: Select all
../system/database/mysqli.php
@daggart: download a later published pversion, e.g. 1.5.6.1 or better and replace the old file with the new.
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
Thank you.
Yes I've already changed the config files to reflect driver mysqli and I'm receiving the above error.
@OSWorX I've replaced the mysqli.php with a version from 1.5.6.4 but now I've got another error with my vqmod.
Warning: mysqli::mysqli(): (HY000/1045): Access denied for user '******'@'localhost' (using password: YES) in /home/dagg00/public_html/vqmod/vqcache/vq2-system_library_db.php on line 12
Fatal error: Call to undefined method mysqli::escape() in /home/dagg00/public_html/vqmod/vqcache/vq2-system_library_db.php on line 20
I've tried clearing cache, but still receiving this error.
Thanks,
Amanda
Yes I've already changed the config files to reflect driver mysqli and I'm receiving the above error.
@OSWorX I've replaced the mysqli.php with a version from 1.5.6.4 but now I've got another error with my vqmod.
Warning: mysqli::mysqli(): (HY000/1045): Access denied for user '******'@'localhost' (using password: YES) in /home/dagg00/public_html/vqmod/vqcache/vq2-system_library_db.php on line 12
Fatal error: Call to undefined method mysqli::escape() in /home/dagg00/public_html/vqmod/vqcache/vq2-system_library_db.php on line 20
I've tried clearing cache, but still receiving this error.
Thanks,
Amanda
Welcome in the world of OpenCart ..
The file db.php had also massive changes from version to version - maybe 1.5.6.4 was too high, 1.5.6.1 should be enough.
Unfortunetaly you have to try the files from different versions (but always both, the mysqli and the db) and see which one can then be used.
At the end it could be that you have to update the whole shop to a better version then 1.5.6.0 (1.5.6.5_rc should be sued then).
One word about your provider: if I would do such with my customers (updating important server components/software) I would have at the end of the week not one customer anymore!
The file db.php had also massive changes from version to version - maybe 1.5.6.4 was too high, 1.5.6.1 should be enough.
Unfortunetaly you have to try the files from different versions (but always both, the mysqli and the db) and see which one can then be used.
At the end it could be that you have to update the whole shop to a better version then 1.5.6.0 (1.5.6.5_rc should be sued then).
One word about your provider: if I would do such with my customers (updating important server components/software) I would have at the end of the week not one customer anymore!
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
@johnchene
Hi,
i have 1.5.5.1 opencart and i am facing the same problem of getting deprcated error and simply changing
didn't work for me i also checked that there is a file lying that is mysqli.php and i also received the following error after changing the define parameter above
Parse error: syntax error, unexpected 'else' (T_ELSE), expecting function (T_FUNCTION) in /home/xxx/public_html/system/database/mysqli.php on line 54
Can you please tell me what fixed everything for you
Thanx
Hi,
i have 1.5.5.1 opencart and i am facing the same problem of getting deprcated error and simply changing
Code: Select all
define('DB_DRIVER', 'mysqli');
Parse error: syntax error, unexpected 'else' (T_ELSE), expecting function (T_FUNCTION) in /home/xxx/public_html/system/database/mysqli.php on line 54
Can you please tell me what fixed everything for you
Thanx
I had the exact same problem with 1.5.5.1 due to change of host PHP to 5.6 (mijndomein).
First I updated both config.php files from mysql to mysqli
After this I had the same error in line 54.
I downloaded 1.5.6.1, and I only uploaded these files:
system/database/mysqli.php
and
system/library/db.php
Don't forget to put the rights to 755 of these files.
And after this all my error messages were gone. Now I have to reinstall VqMod, this is a challenge again !
Greetz,
Marciemarc
First I updated both config.php files from mysql to mysqli
After this I had the same error in line 54.
I downloaded 1.5.6.1, and I only uploaded these files:
system/database/mysqli.php
and
system/library/db.php
Don't forget to put the rights to 755 of these files.
And after this all my error messages were gone. Now I have to reinstall VqMod, this is a challenge again !
Greetz,
Marciemarc
Who is online
Users browsing this forum: No registered users and 195 guests