Post by imager » Thu Jan 28, 2021 2:43 am

[SOLVED]
Running OC 3.0.2.0 and upgraded to PHP 7.3.23, and the hosting company recently moved us to a "cloudlinux PHP" server (more cpu cores, ram, etc).

Today I noticed in the logs that I am seeing a PHP Fatal Error - but I am not seeing any problems on the site itself.

Code: Select all

[27-Jan-2021 18:06:01 UTC] PHP Fatal error:  Class 'mysqli' not found in /home/xxx/public_html/system/library/db/mysqli.php on line 7
[27-Jan-2021 18:07:01 UTC] PHP Fatal error:  Class 'mysqli' not found in /home/xxx/public_html/system/library/db/mysqli.php on line 7
[27-Jan-2021 18:08:01 UTC] PHP Fatal error:  Class 'mysqli' not found in /home/xxx/public_html/system/library/db/mysqli.php on line 7
I located some tech notes (https://stackoverflow.com/questions/398 ... -not-found) and one area of interest was they made mention to ensure the following were installed on the server:

Code: Select all

Curl
ZIP
Zlib
GD Library
Mcrypt
Mbstrings
Xml
I approached the host, and they mentioned: "I have confirmed the listed modules at the end of your response are present. mysql/mysqli no longer exist as of PHP 7.0 and have been replaced by mysqlnd."

I am not sure if I need to be concerned with this error (other than it is going to fill up the log!), and I am not experiencing any "seen" issues.

Could anyone offer any thoughts or advice on this?

Thanks..
Last edited by imager on Sat Jan 30, 2021 12:32 am, edited 1 time in total.

New member

Posts

Joined
Fri Nov 09, 2012 7:05 pm

Post by mikeinterserv » Thu Jan 28, 2021 2:55 am

imager wrote:
Thu Jan 28, 2021 2:43 am
the host, they mentioned: "I have confirmed the listed modules at the end of your response are present. mysql/mysqli no longer exist as of PHP 7.0 and have been replaced by mysqlnd."
I would find another host :-)

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by ADD Creative » Thu Jan 28, 2021 3:02 am

Your host seems confused. The MySQL API was removed in PHP 7, not MySQLi. mysqlnd is the driver used by the MySQLi API.

Also, it would not be possible for OpenCart to function if it cannot assess the database. So something strange must be going on or you do not have the full picture.

www.add-creative.co.uk


Expert Member

Posts

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

Post by imager » Thu Jan 28, 2021 3:09 am

mikeinterserv wrote:
Thu Jan 28, 2021 2:55 am
imager wrote:
Thu Jan 28, 2021 2:43 am
the host, they mentioned: "I have confirmed the listed modules at the end of your response are present. mysql/mysqli no longer exist as of PHP 7.0 and have been replaced by mysqlnd."
I would find another host :-)
I thought the answer was a bit out there. I have asked to have the issue raised to the new support level.

With the error log entry that I am setting, should I see any issues with the site? It seems to be functioning correctly.

New member

Posts

Joined
Fri Nov 09, 2012 7:05 pm

Post by mikeinterserv » Thu Jan 28, 2021 3:19 am

As ADD Creative said just the MySqL was ditched but that's neither here nor there in this case.
It is an error that rarely pop sup and may be related to the library installed on the server.
Its probably NOT a coincidence it happened AFTER a server change.

A FATAL error will USUALLY show up on the front end or backend depending on what was being accessed at the time :-)
Can you UPGRADE to php 7.4

How large is your log for this error and are the timings intermittent or CONSTANT
I think maybe the port became unavailable for some reason on your server.
Last edited by mikeinterserv on Thu Jan 28, 2021 3:24 am, edited 1 time in total.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by imager » Thu Jan 28, 2021 3:24 am

mikeinterserv wrote:
Thu Jan 28, 2021 3:19 am
As ADD Creative said just the MySqL was ditched but that's neither here nor there in this case.
It is an error that rarely pop sup and may be related to the library installed on the server.
Its probably NOT a coincidence it happened AFTER a server change.

A FATAL error will USUALLY show up on the front end or backend depending on what was being accessed at the time :-)
Can you UPGRADE to php 7.4
PHP 7.3 is the highest option available...

New member

Posts

Joined
Fri Nov 09, 2012 7:05 pm

Post by mikeinterserv » Thu Jan 28, 2021 3:24 am

How large is your log for this error and are the timings intermittent or CONSTANT
I think maybe the port became unavailable for some reason on your server.

Something I noticed on the error log
It happened EXACTLY every minute. There must be clue there somewhere.
Last edited by mikeinterserv on Thu Jan 28, 2021 3:39 am, edited 1 time in total.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by imager » Thu Jan 28, 2021 3:38 am

Bit more of an update. The hosting company says :

Code: Select all

[root@SERV-xxxx public_html]# yum list | grep ea-php73 | grep mysql
ea-php73-php-mysqlnd.x86_64         1:7.3.23-1.el7.cloudlinux.2
The support tech also commented:

Code: Select all

mysqlnd does pretend to be mysqli in some cases, due to this the php binary does show mysqli as having already been installed:
[root@SERV-17259 public_html]# /opt/cpanel/ea-php73/root/usr/bin/php -m | grep mysql
mysqli
mysqlnd
pdo_mysql
To me, this seems to imply that mysqlnd does present to be mysqli - and the error message I am seeing is that the connection error being displayed from mysqli.php (line 7) - but it really is not a physical error and everything is fine.

Code: Select all

$this->[07]connection = new \mysqli($hostname, $username, $password, $database, $port);
[08]
[09]		if ($this->connection->connect_error) {
[10]			throw new \Exception('Error: ' . $this->connection->error . '<br />Error No: ' . $this->connection->errno);
		}
Is there a way I can very that things are working as intended, and that this is just an error being thrown for a condition code not being recognized???

New member

Posts

Joined
Fri Nov 09, 2012 7:05 pm

Post by straightlight » Thu Jan 28, 2021 3:41 am

mysqlnd should not pretend anything in anyways. mysqlind, especially with PHP v7.x releases, should alreasdy take the lead at this point. However:
Is there a way I can very that things are working as intended, and that this is just an error being thrown for a condition code not being recognized???
The closing connection and database Engine lookup has recently been fixed on the master branch.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by imager » Thu Jan 28, 2021 3:53 am

mikeinterserv wrote:
Thu Jan 28, 2021 3:24 am
How large is your log for this error and are the timings intermittent or CONSTANT
I think maybe the port became unavailable for some reason on your server.

Something I noticed on the error log
It happened EXACTLY every minute. There must be clue there somewhere.
I just had a look and you are correct, every minute it is occurring.

New member

Posts

Joined
Fri Nov 09, 2012 7:05 pm

Post by mikeinterserv » Thu Jan 28, 2021 4:09 am

Did you look at straighlights suggestion above
what is your MySQL version

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by mikeinterserv » Thu Jan 28, 2021 6:01 am

straightlight wrote:
Thu Jan 28, 2021 3:41 am
The closing connection and database Engine lookup has recently been fixed on the master branch.
Can you point me to it - I can't find it

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by straightlight » Thu Jan 28, 2021 9:33 am

Spoke with user. There was a disaster and recovery plan initiated by the host where the user's specs have changed compared to the last host's packaging location he used to manage his store. Store has moved to a new server. There are no deprecation reports found from PHP industry addressing the fact that mysqlnd would take over versus php mysqli extension.

User created a ticket with host and awaiting the next updates on the incident request ticket knowing if mySQLi extension with PHP can still be used or upgraded to a higher version. mySQL server library currently, and still to the fallback of, v5.0x releases with PHP v7.3.23 release.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Thu Jan 28, 2021 9:53 am

Additional note to this. mysqlnd (memcache) has been recently updated on the master branch as well.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by mikeinterserv » Thu Jan 28, 2021 10:09 am

straightlight wrote:
Thu Jan 28, 2021 9:33 am
There are no deprecation reports found from PHP industry addressing the fact that mysqlnd would take over versus php mysqli extension.
User created a ticket with host and awaiting the next updates on the incident request ticket knowing if mySQLi extension with PHP can still be used or upgraded to a higher version. mySQL server library currently, and still to the fallback of, v5.0x releases with PHP v7.3.23 release.
MySQLND is the DRIVER - Mysqli is the API - The DRIVER does NOT TAKE OVER the APi - They are NOT even the same thing - MySqli is a library installed on the server, It is installed on the OPs server or his site would NOT WORK . MySQLND is the newer NATIVE DRIVER in PHP.
straightlight wrote:
Thu Jan 28, 2021 9:33 am
knowing if mySQLi extension with PHP can still be used or upgraded to a higher version. mySQL server library currently
:-) You are mixing up MySQL the OLD native driver in php with MySQLND the newer DRIVER and MySQLi the API

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by paulfeakins » Thu Jan 28, 2021 5:27 pm

straightlight wrote:
Thu Jan 28, 2021 9:53 am
Additional note to this. mysqlnd (memcache) has been recently updated on the master branch as well.
Good work!

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by ADD Creative » Thu Jan 28, 2021 7:13 pm

straightlight wrote:
Thu Jan 28, 2021 9:53 am
Additional note to this. mysqlnd (memcache) has been recently updated on the master branch as well.
Where?

www.add-creative.co.uk


Expert Member

Posts

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

Post by straightlight » Fri Jan 29, 2021 11:13 pm

OP User has resolved the issue; originating from cron job synched with square payments. User disabled the cron job, issue resolved.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by mikeinterserv » Fri Jan 29, 2021 11:25 pm

straightlight wrote:
Fri Jan 29, 2021 11:13 pm
OP User has resolved the issue; originating from cron job synched with square payments. User disabled the cron job, issue resolved.
Makes complete sense and explains why it was EXACTLY every 1 minute. Thanks for the update

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by imager » Sat Jan 30, 2021 12:13 am

You nailed it exactly with your comment early on about occurring every minute. I set out this morning to figure out what happens on a timed basis, which took me to CRON, and there it was..

Feels good to find and fix - but what trip to get here....

Thanks mikeinterserv for the observation (that I should have taken more notice of) and to straightlight for his continued support and advice...
mikeinterserv wrote:
Fri Jan 29, 2021 11:25 pm
straightlight wrote:
Fri Jan 29, 2021 11:13 pm
OP User has resolved the issue; originating from cron job synched with square payments. User disabled the cron job, issue resolved.
Makes complete sense and explains why it was EXACTLY every 1 minute. Thanks for the update

New member

Posts

Joined
Fri Nov 09, 2012 7:05 pm
Who is online

Users browsing this forum: No registered users and 336 guests