Post by WaltonCreative » Thu Apr 23, 2015 11:13 pm

Hi,

I am trying to update an old installation of CW 1.5.4 to the latest version. So far all seems to make sense, except when I have refreshed the browser I get this error:

Error: Could not load database driver mysql!

Looking at previous threads it definitely exists at system/database/mysql.php and has permissions 755 and even 777, nothing seems to make any difference.

The updated site is on a subdomain here: http://update.maisonhomeinteriors.com

Any ideas?

New member

Posts

Joined
Thu Nov 01, 2012 5:48 am

Post by ocmobi » Thu Apr 23, 2015 11:55 pm

You should try switching to mysql=>mysqli, maybe the newer version doesn't like mysql, it's being deprecated I think anyway.

Also confirm your front end and admin config are updated with correct paths/setup if you are updating to a new version and it's pointing to the right folders to be looking for db drivers.

OCMobi - Opencart 1x and 2x native mobile applications, developer SDKs, Rest API, and custom services. Email us at support@ocmobi.com!

Pricing | Features | Custom Services
Facebook | Twitter | Google+ | Instagram


User avatar
New member

Posts

Joined
Wed Mar 04, 2015 1:41 am


Post by WaltonCreative » Fri Apr 24, 2015 1:14 am

It all worked for a while - with the expected loads of errors. But now I have added all of the updated files it has come back with this error. So I guess it must still be pointing to the correct db.

How do I switch the DB to mysqli ?

New member

Posts

Joined
Thu Nov 01, 2012 5:48 am

Post by rph » Fri Apr 24, 2015 1:17 am

Your PHP version probably got upgraded without you being notified. Edit the DB_DRIVER setting in /config.php and /admin/config.php. If you have trouble figuring it out do a search of the forum. It's a common issue. You'll find dozens of threads on it.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by WaltonCreative » Fri Apr 24, 2015 1:30 am

Sorry, I am still in the dark as to what to do.

I did a search for "Edit the DB_DRIVER setting" as you suggested and got 11 replies none of which were helpful.

Could you possibly either tell me what to do or possible give me a link to the page showing all the magic answers?

Thanks!

New member

Posts

Joined
Thu Nov 01, 2012 5:48 am

Post by ocmobi » Fri Apr 24, 2015 1:37 am

There are two files, config.php and admin/config.php, LOOK IN THOSE TWO FILES. You will see the DB_DRIVER constant in php code, try changing it from mysql to mysqli, it's not a database it's a "driver". A driver is a php file/code opencart uses to process database requests in the code. If you change the driver the error may go away, change it to "mysqli".

OCMobi - Opencart 1x and 2x native mobile applications, developer SDKs, Rest API, and custom services. Email us at support@ocmobi.com!

Pricing | Features | Custom Services
Facebook | Twitter | Google+ | Instagram


User avatar
New member

Posts

Joined
Wed Mar 04, 2015 1:41 am


Post by WaltonCreative » Fri Apr 24, 2015 1:47 am

Hiya,

I tried doing that - the error just changed to saying: Error: Could not load database driver mysqli!

New member

Posts

Joined
Thu Nov 01, 2012 5:48 am

Post by ocmobi » Fri Apr 24, 2015 1:55 am

It sounds like it's just a file system error, like your paths are wrong so when it goes to load the file /<path to file>/mysqli.php for example it's not there because your path is wrong.

Did you go through the install/setup script properly? Can you confirm your paths in both config files are correct? Check your php error log, you should see the exact error message w/ path and if the file isn't there than you know your path is wrong and the configs need to be updated.

OCMobi - Opencart 1x and 2x native mobile applications, developer SDKs, Rest API, and custom services. Email us at support@ocmobi.com!

Pricing | Features | Custom Services
Facebook | Twitter | Google+ | Instagram


User avatar
New member

Posts

Joined
Wed Mar 04, 2015 1:41 am


Post by WaltonCreative » Fri Apr 24, 2015 2:12 am

I am currently running the site on a subdomain http://update.maisonhomeinteriors.com/

These are my admin/ config.php settings:

<?php
// HTTP
define('HTTP_SERVER', 'http://update.maisonhomeinteriors.com/admin/');
define('HTTP_CATALOG', 'http://update.maisonhomeinteriors.com/');
define('HTTP_IMAGE', 'http://update.maisonhomeinteriors.com/image/');

// HTTPS
define('HTTPS_SERVER', 'http://update.maisonhomeinteriors.com/admin/');
define('HTTPS_CATALOG', 'https://update.maisonhomeinteriors.com/');
define('HTTPS_IMAGE', 'https://update.maisonhomeinteriors.com/image/');

// DIR
define('DIR_APPLICATION', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/admin/');
define('DIR_SYSTEM', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/');
define('DIR_DATABASE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/database/');
define('DIR_LANGUAGE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/admin/language/');
define('DIR_TEMPLATE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/admin/view/template/');
define('DIR_CONFIG', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/config/');
define('DIR_IMAGE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/image/');
define('DIR_CACHE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/cache/');
define('DIR_DOWNLOAD', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/download/');
define('DIR_LOGS', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/logs/');
define('DIR_CATALOG', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/catalog/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'XXXXXXX');
define('DB_PASSWORD', 'XXXX');
define('DB_DATABASE', 'XXXXXX');
define('DB_PREFIX', '');
?>

And the settings for the root config.php

<?php
// HTTP
define('HTTP_SERVER', 'http://update.maisonhomeinteriors.com/');
define('HTTP_IMAGE', 'http://update.maisonhomeinteriors.com/image/');
define('HTTP_ADMIN', 'http://update.maisonhomeinteriors.com/admin/');

// HTTPS
define('HTTPS_SERVER', 'https://update.maisonhomeinteriors.com/');
define('HTTPS_IMAGE', 'https://update.maisonhomeinteriors.com/image/');

// DIR
define('DIR_APPLICATION', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/catalog/');
define('DIR_SYSTEM', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/');
define('DIR_DATABASE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/database/');
define('DIR_LANGUAGE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/catalog/language/');
define('DIR_TEMPLATE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/catalog/view/theme/');
define('DIR_CONFIG', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/config/');
define('DIR_IMAGE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/image/');
define('DIR_CACHE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/cache/');
define('DIR_DOWNLOAD', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/download/');
define('DIR_LOGS', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/logs/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', XXXXX');
define('DB_PASSWORD', 'XXXXXX');
define('DB_DATABASE', 'XXXXXX');
define('DB_PREFIX', '');
?>

New member

Posts

Joined
Thu Nov 01, 2012 5:48 am

Post by ocmobi » Fri Apr 24, 2015 2:15 am

So what you do is find mysqli.php and mysql.php in the system/database folder and see if /var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/database/mysqli.php exists and you can access it and if it's not there that's a problem. Or if permissions/ownership is wrong that's a problem.

OCMobi - Opencart 1x and 2x native mobile applications, developer SDKs, Rest API, and custom services. Email us at support@ocmobi.com!

Pricing | Features | Custom Services
Facebook | Twitter | Google+ | Instagram


User avatar
New member

Posts

Joined
Wed Mar 04, 2015 1:41 am


Post by WaltonCreative » Fri Apr 24, 2015 5:34 pm

Hiya,

Sorry, still no luck. I duplicated the file mysql.php in the database folder and renamed it mysqli.php, so both now exist.

So going to: http://update.maisonhomeinteriors.com/s ... mysqli.php you get a blank page not a 404, so it does exist.

I have checked the permissions and they are both set to 755 or 777, neither of which fix it.

---

I have now deleted the contents of both config.php and admin/config.php files so that I can try redoing the install.

I have gone through the installation process again and STILL get the same error:
Error: Could not load database driver mysqli!

---

Sorry to be a pain, Any other ideas?

New member

Posts

Joined
Thu Nov 01, 2012 5:48 am

Post by WaltonCreative » Fri Apr 24, 2015 5:55 pm

PS - I have just downloaded a fresh updated version of OpenCart and discovered that there is no such folder as this: system/database

The mysql.php and mysqli.php files are both stored here: system/library/db/

So does that mean in my config.php documents, the location of the file should actually read:

define('DIR_DATABASE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/library/db/');

instead of this:

define('DIR_DATABASE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/database/');

???

New member

Posts

Joined
Thu Nov 01, 2012 5:48 am

Post by WaltonCreative » Mon Apr 27, 2015 5:06 pm

Sorry - I am now completely stumped.

I have deleted everything in both config.php and admin/config.php documents. Then tried to go back to the subdomain.mywebsite.com/install file which once I have filled it all in again says everything is ok. I get the screen saying all the files are there and writable. Finally getting the screen that says all installed and for me to remember to delete my install folder.

When I then click on either of the links to my shop or the admin, both of them still say:

Error: Could not load database driver mysqli!

Is there anything anyone can suggest I do rather than delete the whole update and start afresh updating all the files into my old version of CW? (this took a day and a half last time!).

help please!

New member

Posts

Joined
Thu Nov 01, 2012 5:48 am

Post by artcore » Mon Apr 27, 2015 6:05 pm

What about removing the 'subdomains' from the define?

Code: Select all

/var/www/vhosts/maisonhomeinteriors.com/update/system/database/
If you check your ftp, is that subdomains folder present?
Just thinking out loud.

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by WaltonCreative » Tue Apr 28, 2015 9:16 pm

Hiya,

Yes it is definitely there - I have been uploading files to it.

I did have a thought that the actual NAME of the subdomain might be the problem? called "UPDATE" but I am sure there are no restrictions on subdomain names.

Any other thoughts gratefully received!

New member

Posts

Joined
Thu Nov 01, 2012 5:48 am

Post by artcore » Tue Apr 28, 2015 11:49 pm

If you're using OC 1.5.x the system/database is correct. For OC2.x it's library/db
Sorry, still no luck. I duplicated the file mysql.php in the database folder and renamed it mysqli.php, so both now exist.
I attached a fresh copy of mysqli.php
Put it in your system/database folder.

This also should work

Code: Select all

define('DIR_DATABASE', 'system/database/');

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by WaltonCreative » Wed Apr 29, 2015 12:20 am

Thank you for your suggestions.

I have added define('DIR_DATABASE', 'system/database/'); to both config.php files and uploaded the new file...

Sadly still not a squeak of a difference.

Here it the content of the config.php file created:

<?php
// HTTP
define('HTTP_SERVER', 'http://update.maisonhomeinteriors.com/');

// HTTPS
define('HTTPS_SERVER', 'http://update.maisonhomeinteriors.com/');

// DIR
define('DIR_DATABASE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/database/');
define('DIR_APPLICATION', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/catalog/');
define('DIR_SYSTEM', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/');
define('DIR_LANGUAGE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/catalog/language/');
define('DIR_TEMPLATE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/catalog/view/theme/');
define('DIR_CONFIG', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/config/');
define('DIR_IMAGE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/image/');
define('DIR_CACHE', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/cache/');
define('DIR_DOWNLOAD', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/download/');
define('DIR_UPLOAD', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/upload/');
define('DIR_MODIFICATION', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/modification/');
define('DIR_LOGS', '/var/www/vhosts/maisonhomeinteriors.com/subdomains/update/system/logs/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'XXXXXX');
define('DB_PASSWORD', 'XXXXXX');
define('DB_DATABASE', 'XXXXX');
define('DB_PREFIX', '');

New member

Posts

Joined
Thu Nov 01, 2012 5:48 am

Post by artcore » Wed Apr 29, 2015 1:01 am

define('DIR_MODIFICATION'
So you are using OC2? In that case you need a different library/db/mysqli.php
In my config for OC v2.0.2.0 is no define for the database.

edit: On further inspection, OC2 uses the autoloader in startup.php which loads all the needed libraries. IOW no more need for a db define.
So check the library/db.php and library/db/mysqli.php
Or... it has to do with namespaces, see if your PHP version is >= 5.3.0 although you shouldn't have been able to install.

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by WaltonCreative » Wed Apr 29, 2015 4:30 pm

Hiya, thanks again for your help.

I was sent a different version of the mysqli.php file yesterday. One of them starts:

<?php
namespace DB;
final class MySQLi {
private $link;

The other one starts:

<?php
final class DBMySQLi {
private $link;

Which is the correct one?

I am confused! Trying either one of them I still get the error. I am using PHP Version 5.3.29.

I am beginning to think I have no choice but to spend another day going through every single file from the latest version of OC and updating my copy again - not something I relish! : (

New member

Posts

Joined
Thu Nov 01, 2012 5:48 am

Post by artcore » Wed Apr 29, 2015 4:48 pm

The one with the namespace is for OC2.
It seems like this installation of yours is for testing and is empty? Start from scratch with the correct files, no upgrade, just all new beginnings :)

I wouldn't mind checking it for you if nothing helps. A PM is ok.

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands
Who is online

Users browsing this forum: No registered users and 27 guests