Page 1 of 1

Mysqli error php version 7

Posted: Wed Oct 02, 2019 5:39 pm
by Evilonion
Hi, I have the site running 3.02
I upgraded the php version to 7.2 and the error logs are full of this error:

PHP Warning: DB\MySQLi::__construct(): Couldn't fetch mysqli in /var/sites/f/website/public_html/system/library/db/mysqli.php on line 10

I contacted the host and they said to lower the version number as mysqli is version 7 and above.
The only issue there is that the next available version down is 5.6 and the site does not work if I select that.

Re: Mysqli error php version 7

Posted: Wed Oct 02, 2019 6:04 pm
by thekrotek
But you have an issue related exactly to mysqli. Looks like it simply isn't enabled on your server.

Re: Mysqli error php version 7

Posted: Wed Oct 02, 2019 6:34 pm
by Evilonion
From php info page

mysqli.allow_local_infile On
mysqli.allow_persistent On
mysqli.default_host value no mysqli.default_port33063306
mysqli.default_pw no value no mysqli.default_socket/var/lib/mysql/mysql.sock/var/lib/mysql/mysql.sockmysqli.default_user no value no
mysqli.max_links Unlimited mysqli.max_persistent Unlimited
mysqli.reconnect On
mysqli.rollback_on_cached_plink Off
mysqlndmysqlnd enabled
Versionmysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $Compressionsupportedcore SSLsupportedextended SSLsupportedCommand buffer size4096
Read buffer size32768
timeout31536000
Collecting statistics Yes
Collecting memory statistics No
Tracingn/aLoaded pluginsmysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_sha256_passwordAPI Extensionsmysqli,pdo_mysql

Re: Mysqli error php version 7

Posted: Wed Oct 02, 2019 7:13 pm
by Nathaniel2019
thekrotek wrote:
Wed Oct 02, 2019 6:04 pm
But you have an issue related exactly to mysqli. Looks like it simply isn't enabled on your server.
"LOOKS LIKE IT SIMPLY ISNT ENABLED ON YOUR SERVER"

Re: Mysqli error php version 7

Posted: Wed Oct 02, 2019 9:57 pm
by Evilonion
Mysqli is enabled.
The host has told me it's an opencart issue and likely wrong config... any ideas?

php
// HTTP
define('HTTP_SERVER', 'https://*****/');

// HTTPS
define('HTTPS_SERVER', 'https://*****/');

// DIR
define('DIR_APPLICATION', '/var/sites/f/*****/public_html/catalog/');
define('DIR_SYSTEM', '/var/sites/f/*****/public_html/system/');
define('DIR_IMAGE','/var/sites/f/*****/public_html/image/');
define('DIR_STORAGE', '/var/sites/f/*****/storage/');
define('DIR_LANGUAGE', DIR_APPLICATION . 'language/');
define('DIR_TEMPLATE', DIR_APPLICATION . 'view/theme/');
define('DIR_CONFIG', DIR_SYSTEM . 'config/');
define('DIR_CACHE', DIR_STORAGE . 'cache/');
define('DIR_DOWNLOAD', DIR_STORAGE . 'download/');
define('DIR_LOGS', DIR_STORAGE . 'logs/');
define('DIR_MODIFICATION', DIR_STORAGE . 'modification/');
define('DIR_SESSION', DIR_STORAGE . 'session/');
define('DIR_UPLOAD', DIR_STORAGE . 'upload/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', '*****');
define('DB_USERNAME', '*****');
define('DB_PASSWORD', '*****');
define('DB_DATABASE', '*****');
define('DB_PORT', '3306');
define('DB_PREFIX', 'oc_');

Re: Mysqli error php version 7

Posted: Wed Oct 02, 2019 10:30 pm
by paulfeakins
Evilonion wrote:
Wed Oct 02, 2019 5:39 pm
I contacted the host and they said to lower the version number as mysqli is version 7 and above.
The only issue there is that the next available version down is 5.6 and the site does not work if I select that.
Either use PHP 5.6 - not recommended as it may not be secure.
Or install mysqli, your host should do that for you or at least tell you how.

Re: Mysqli error php version 7

Posted: Wed Oct 02, 2019 10:36 pm
by thekrotek
Evilonion wrote:
Wed Oct 02, 2019 9:57 pm
Mysqli is enabled.
The host has told me it's an opencart issue and likely wrong config... any ideas?
No, it is NOT an OpenCart issue and mysqli is not functioning properly on your server. Contact your hosting support on the matter.

Re: Mysqli error php version 7

Posted: Wed Oct 02, 2019 10:57 pm
by Evilonion
Ok thankyou for replying
I have contacted the host and even though mysqli is enabled they have made a new php.ini file and enabled mysqli there.
This seems to have resolved the issue but I wont know for an hour or so when I check error logs again.

Re: Mysqli error php version 7

Posted: Wed Oct 02, 2019 11:39 pm
by paulfeakins
Evilonion wrote:
Wed Oct 02, 2019 10:57 pm
This seems to have resolved the issue but I wont know for an hour or so when I check error logs again.
Surely nothing would work if that wasn't correctly installed, so if it seems to be working, it probably is.

Re: Mysqli error php version 7

Posted: Thu Oct 03, 2019 6:01 am
by Evilonion
Ok so since the php.ini file was created I'm getting lots of this error repeating:

PHP Warning: mysqli::query(): MySQL server has gone away in /var/sites/f/****.co.uk/public_html/system/library/db/mysqli.php on line 18

PHP Warning: mysqli::query(): Error reading result set's header in /var/sites/f/****.co.uk/public_html/system/library/db/mysqli.php on line 18

Re: Mysqli error php version 7

Posted: Thu Oct 03, 2019 6:40 am
by by mona
This sounds like your server connection is timing out
It is still a hosting issue ...

(it could possibly be that your site is being backed-up, but that should have cleared already)

Re: Mysqli error php version 7

Posted: Thu Oct 03, 2019 4:52 pm
by paulfeakins
Evilonion wrote:
Thu Oct 03, 2019 6:01 am
MySQL server has gone away
Usually means your host doesn't have enough resources for your site.