Post by ihateusernames » Fri Sep 30, 2022 10:07 am

Hi,

Today I started getting some errors pop up on my oc website & admin pages....

First error on page states:
Warning: mysqli::__construct(): Headers and client library minor version mismatch. Headers:100608 Library:30302 in /home/redacted/shop.indonesianwholesaler.com/system/library/db/mysqli.php on line 7

Second pop up window error in admin states:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
OK
<b>Warning</b>: mysqli::__construct(): Headers and client library minor version mismatch. Headers:100608 Library:30302 in <b>/home/redacted/shop.indonesianwholesaler.com/system/library/db/mysqli.php</b> on line <b>7</b>{"order":{"label":"Orders","data":[[1,0],[2,0],[3,0],[4,0],[5,0],[6,0],[7,0],[8,0],[9,0],[10,0],[11,0],[12,0],[13,0],[14,0],[15,0],[16,0],[17,0],[18,0],[19,0],[20,0],[21,0],[22,0],[23,0],[24,0],[25,0],[26,0],[27,0],[28,0],[29,0],[30,0]]},"customer":{"label":"Customers","data":[[1,0],[2,0],[3,0],[4,0],[5,"1"],[6,0],[7,0],[8,0],[9,0],[10,"2"],[11,0],[12,0],[13,0],[14,0],[15,0],[16,0],[17,0],[18,"1"],[19,0],[20,0],[21,"1"],[22,0],[23,0],[24,0],[25,"1"],[26,"1"],[27,0],[28,0],[29,"1"],[30,0]]},"xaxis":[["1","01"],["2","02"],["3","03"],["4","04"],["5","05"],["6","06"],["7","07"],["8","08"],["9","09"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"],["16","16"],["17","17"],["18","18"],["19","19"],["20","20"],["21","21"],["22","22"],["23","23"],["24","24"],["25","25"],["26","26"],["27","27"],["28","28"],["29","29"],["30","30"]]}

Third pop up window error in admin states:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
OK
<b>Warning</b>: mysqli::__construct(): Headers and client library minor version mismatch. Headers:100608 Library:30302 in <b>/home/redacted/shop.indonesianwholesaler.com/system/library/db/mysqli.php</b> on line <b>7</b>{"nl":{"total":"1","amount":"7,930,000 Rp"},"ae":{"total":"1","amount":"1,605,000 Rp"},"gb":{"total":"5","amount":"38,970,000 Rp"},"vn":{"total":"1","amount":"4,295,000 Rp"}}

So I'm currently looking around at the db data & php files, but not sure exactly what's happened...I currently can't change/save any store settings in admin to stop the errors from showing on the live site. I found some currency symbols had become corrupted/changed & I was able to change & save those ok within the admin pages. Some data isn't displaying as well on the admin home page dashboard (map/sales analytics). I'll keep investigating further, but thought I'd ask/see if anyone knows what might have caused this to happen overnight & if there's any known solutions. Thanks in advance for any input.

Using OC Version 3.0.3.2


Active Member

Posts

Joined
Wed Jul 24, 2019 10:31 am

Post by ihateusernames » Fri Sep 30, 2022 2:40 pm

A couple more errors that I've now spotted..
a) Store setting/saving issue is a result of the country/region menus not working as they should (so possibly another json error).
b) Some custom fields appearing in places/stores they shouldn't (in both live websites & admin pages)
All errors happen across all stores & themes.
In the actual db, the data all looks ok, as far as I can tell. Except for the currency symbols that I mentioned in my first message, which I was able to reset/save & fix.

Using OC Version 3.0.3.2


Active Member

Posts

Joined
Wed Jul 24, 2019 10:31 am

Post by paulfeakins » Fri Sep 30, 2022 6:46 pm

Did you try Googling the error message?
https://stackoverflow.com/questions/107 ... n-mismatch

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by ihateusernames » Sat Oct 01, 2022 10:49 am

Thanks Paul,

I've searched online regarding the errors & they seem to suggest that the php version has changed or needs updating. So I contacted my webserver host & they have said that there's been no changes or upgrades to any php/mysqli versions this week. I've also not changed any system settings or updated anything in oc.

So whilst the error message suggests a php version mismatch, there's nothing to update? So if that is the problem, how can I fix it?

I've looked at oc pages online & I can't find anything that tells me which version of php is actually running in v3.0.3.2. If I could, I could check that it's set correctly on the server as well. Although as I mentioned, nothing has been altered for this error to suddenly happen.
Thanks...

Using OC Version 3.0.3.2


Active Member

Posts

Joined
Wed Jul 24, 2019 10:31 am

Post by ihateusernames » Sat Oct 01, 2022 12:44 pm

Can someone verify what the correct 'server connection collation' should be for oc v3.0.3.2. ? utf8mb4_unicode_ci or latin1_sweedish_ci etc...? I'm just looking through all the global server db settings to check they are correct, thanks.


PS OC Devs: it would be very useful to have an 'about oc' in the dashboard or users drop down menu, giving you all the system versions used/running as well as all the server systems required to run oc compatibly. (ie: php/sqli/json/etc...) tec spec

Using OC Version 3.0.3.2


Active Member

Posts

Joined
Wed Jul 24, 2019 10:31 am

Post by OSWorX » Sat Oct 01, 2022 3:48 pm

ihateusernames wrote:
Sat Oct 01, 2022 12:44 pm
Can someone verify what the correct 'server connection collation' ..
utf8mb4_unicode_ci or latin1_sweedish_ci ..
utf8mb4_unicode_ci regardless of the OC-Version

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by ihateusernames » Mon Oct 03, 2022 9:36 am

Thanks osworx,

so server db settings all look ok.....the startup.php file in the system folder says php v5.4+, is this correct? I've also noticed that in the db folder the $ports for mpdo/mysql/mysqli php files are all the same & different for mssql/postgre. I don't know if that is also correct or not?

At present I still have no idea why this error is happening or how to solve it. If any oc devs understand what is happening, your input would be appreciated, thanks.

Using OC Version 3.0.3.2


Active Member

Posts

Joined
Wed Jul 24, 2019 10:31 am

Post by paulfeakins » Mon Oct 03, 2022 6:19 pm

ihateusernames wrote:
Mon Oct 03, 2022 9:36 am
At present I still have no idea why this error is happening or how to solve it. If any oc devs understand what is happening, your input would be appreciated, thanks.
If no one can answer here for free, you could pay a developer such as ourselves or post a job in the Commercial Support Forum.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by ADD Creative » Mon Oct 03, 2022 6:21 pm

ihateusernames wrote:
Mon Oct 03, 2022 9:36 am
Thanks osworx,

so server db settings all look ok.....the startup.php file in the system folder says php v5.4+, is this correct? I've also noticed that in the db folder the $ports for mpdo/mysql/mysqli php files are all the same & different for mssql/postgre. I don't know if that is also correct or not?

At present I still have no idea why this error is happening or how to solve it. If any oc devs understand what is happening, your input would be appreciated, thanks.
The issue is likely to be with the PHP on your server. I would ask your host to look into it for you.

It your hosting has a control panel there may be an option to see and change the the version of PHP. If your hosting control panel gives you the option of selecting extensions make sure mysqlnd is selected.

You can also use phpinfo() in a .php to find your PHP version.
https://www.php.net/manual/en/function.phpinfo.php

Also, if your site is a live site you need to switch off displaying of errors. Then look in you logs for errors.

You need make sure display errors in set to off in all 3 places. Your PHP settings, in system/config/default.php and in the settings. Not only can this cause minor notices and warnings to cause bigger errors, as you have seen, it can also be a security risk.

1. In your PHP settings make sure display_errors is set to Off. Use phpinfo() to check. It should be off by default, but there are lots of rubbish hosts out there.

2. In system/config/default.php set error_display to false.

3. In your OpenCart Setting on the server tab set Display Errors to No.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by ADD Creative » Mon Oct 03, 2022 6:23 pm

OSWorX wrote:
Sat Oct 01, 2022 3:48 pm
utf8mb4_unicode_ci regardless of the OC-Version
Dose using utf8mb4_unicode_ci offer any advantages over utf8_unicode_ci? Without change the the set charset in the database classes you still wouldn't be able to use 4 byte charactors.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by OSWorX » Mon Oct 03, 2022 8:42 pm

ADD Creative wrote:
Mon Oct 03, 2022 6:23 pm
OSWorX wrote:
Sat Oct 01, 2022 3:48 pm
utf8mb4_unicode_ci regardless of the OC-Version
Dose using utf8mb4_unicode_ci offer any advantages over utf8_unicode_ci? Without change the the set charset in the database classes you still wouldn't be able to use 4 byte charactors.
Read by yourself, just for example (a look with your preferred search engine by yourself would bring nearly the same results):
https://stackoverflow.com/questions/766 ... unicode-ci
https://www.eversql.com/mysql-utf8-vs-u ... d-utf8mb4/
https://eqsash.com/articles/kakuyu-kodi ... hibki?l=en

and finally one from Drupal (now 7 years old - but still valid):
https://drupal.stackexchange.com/questi ... unicode-ci

p.s.: WP use it also ..

nb: just to mention it, if your language is English (and only that and none further), it would make no difference in using utf8mb4_unicode_ci compared to utf8_unicode_ci.
Why?
Because English is a very simple language, no "umlauts" (like in German) or other special characters (e.g. like French, etc.).

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by OSWorX » Mon Oct 03, 2022 8:47 pm

ihateusernames wrote:
Mon Oct 03, 2022 9:36 am
At present I still have no idea why this error is happening or how to solve it. If any oc devs understand what is happening, your input would be appreciated, thanks.
As paul already mentioned, better to hire an experienced developer, rather wasting time (and possible sells)!

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by ADD Creative » Tue Oct 04, 2022 12:16 am

OSWorX wrote:
Mon Oct 03, 2022 8:42 pm
ADD Creative wrote:
Mon Oct 03, 2022 6:23 pm
OSWorX wrote:
Sat Oct 01, 2022 3:48 pm
utf8mb4_unicode_ci regardless of the OC-Version
Dose using utf8mb4_unicode_ci offer any advantages over utf8_unicode_ci? Without change the the set charset in the database classes you still wouldn't be able to use 4 byte charactors.
Read by yourself, just for example (a look with your preferred search engine by yourself would bring nearly the same results):
https://stackoverflow.com/questions/766 ... unicode-ci
https://www.eversql.com/mysql-utf8-vs-u ... d-utf8mb4/
https://eqsash.com/articles/kakuyu-kodi ... hibki?l=en

and finally one from Drupal (now 7 years old - but still valid):
https://drupal.stackexchange.com/questi ... unicode-ci

p.s.: WP use it also ..

nb: just to mention it, if your language is English (and only that and none further), it would make no difference in using utf8mb4_unicode_ci compared to utf8_unicode_ci.
Why?
Because English is a very simple language, no "umlauts" (like in German) or other special characters (e.g. like French, etc.).
Those links didn't tell me anything I didn't already know. Perhaps my question wasn't worded as well as it could of been.

What I was trying to ask was. If there was any point in using utf8mb4 without also changing the charset of the mysqli driver to utf8mb4? As without changing the charset of the mysqli driver you will still be limited to 3 byte characters.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by ihateusernames » Tue Oct 04, 2022 11:16 am

Thanks addcreative,

I had previously tried switching off the error displays but I didn't know about the second method in default.php, so I was still getting the error messages displayed. After switching it to false the error messages have stopped. Strangely, the errors themselves also stop when the display error messages is switched off in all three places? Is that normal behaviour for oc? I would of assumed that the errors would still occur, just without the messages/notifications?

My server host previously stated that no changes had been made to any settings or any php versions added/altered etc... They said it 'sounded' like a software problem rather than a server issue. I also haven't changed any server settings or altered any versions. I've attached a screenshot of my current php version settings in cpanel & can easily select other versions (as displayed) if they are 'more' compatible. I would assume that the php version currently selected was the one oc 'set' when I originally installed oc.

Thanks to those who have offered their professional services, but I'd first like to give the oc devs a chance to solve any user issue's. Thanks for any assistance offered so far....

Attachments

Screenshot 2022-10-03 at 09-16-29 cPanel -.png

Screenshot 2022-10-03 at 09-16-29 cPanel -.png (95.43 KiB) Viewed 380 times


Using OC Version 3.0.3.2


Active Member

Posts

Joined
Wed Jul 24, 2019 10:31 am

Post by OSWorX » Tue Oct 04, 2022 4:06 pm

ADD Creative wrote:
Tue Oct 04, 2022 12:16 am
Those links didn't tell me anything I didn't already know. Perhaps my question wasn't worded as well as it could of been.

What I was trying to ask was. If there was any point in using utf8mb4 without also changing the charset of the mysqli driver to utf8mb4? As without changing the charset of the mysqli driver you will still be limited to 3 byte characters.
Quite fair - was not clear O0
But you are right, the charset should be also defined correctly when using utf8mb4.
Used in OC 2.3.x and 3.x:
$this->connection->set_charset("utf8");
With OC 4.x it is set correct:
$this->connection->set_charset('utf8mb4');

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: Majnoon and 24 guests