1

It's my first time using OpenCart. A strange issue appeared, when I've tried to install OpenCart version 1.5.4 on my computer. I've searched for an answer on forums, but community is not as large as WP's one.

enter image description here

I am using

Linux (Elementary OS - so Debian based), with 
LAMPP installed on my machine. 
PHP 7, 
10.1.13-MariaDB (innodb_version 5.6.28-76.1),  

I don't have any problem installing OC 2.x.x on my computer, but installing 1.5.4 provides me with this message (image). I've tried to uncomment (and then restart lampp) extension=php_mysql.dll (php.ini), but that doesn't help.

What I am doing wrong? Keep in mind, I need to install this version, I've already tried 2.x (it works normally)!

AlFra
  • 379
  • 1
  • 6
  • 17
  • You have `MariaDB` installed but are trying to connect to a `MySQL` database. I think that's your problem. I don't think you can use the MySQL database selection for a fork of MySQL. – Bram Jun 04 '16 at 09:52
  • Possible duplicate [of this question](https://stackoverflow.com/questions/36036465/warning-mysql-extension-needs-to-be-loaded-for-opencart-to-work/36318941). AlFra, please determine your loaded PHP modules from `phpinfo()` and add them inside your question please. – halfer Jun 04 '16 at 09:54
  • @Bram: isn't MariaDB meant to be a drop-in replacement for MySQL? This seems to be a database extension/driver problem, not the actual database. I'm wondering whether it is looking for the old MySQL extension that was removed in PHP 7 (though [the requirements](http://docs.opencart.com/requirements/) say that MySQLi is fine). – halfer Jun 04 '16 at 09:55
  • MariaDB shouldn't be the problem, it is still the mysql branch. I don't know. I don't have any problems installing 2.x.x versions, I don't have problem installing wordpress, joomla, etc. Requirements say it is fine indeed. it is weird – AlFra Jun 04 '16 at 10:02
  • @halfer this guy has (probably) the same problem, but there was never a solution posted. He has php 5.5.33 installed on his computer, so even if I downgrade I could receive the same message. – AlFra Jun 04 '16 at 10:10
  • 1
    "even if I downgrade I could receive the same message" - not necessarily. PHP5.5 has the `mysql` extension enabled by default, but on PHP7 it has been removed entirely. I wonder if OpenCart is insisting on this old deprecated module even though it claims to work with `mysqli`? – halfer Jun 04 '16 at 10:14
  • i am going to try. (& update you in a few) – AlFra Jun 04 '16 at 10:15
  • 1
    @halfer this indeed worked. Please post your answer as an actual answer so I can checked it as accepted one. – AlFra Jun 04 '16 at 10:34

2 Answers2

4

I realised that the 1.5.x branch of this system is quite old. If you take a look at the source for the installer file, it insists on the mysql extension. You could try hacking that, but my guess would be that it uses mysql_ calls throughout, and the whole product won't work.

As soon as you move to the 2.0.x tree, the number of permissible database extensions grows quite a bit. From this version, you can use any of these:

mysql, mysqli, pgsql, pdo

Note that mysql has been deprecated for quite a while, and in PHP 7 it was finally removed. You therefore are unlikely to be able to use OC 1.5 together with PHP 7.

Your possible solutions are:

  • Downgrade to latest PHP5.x
  • Upgrade OpenCart to 2.x
halfer
  • 19,824
  • 17
  • 99
  • 186
  • 1
    it is as you've said. I've downgraded, I don't get error message anymore. One question though: do you have any experience with migration from 1.5 to 2.0 (especially database). do you know where can I find answer? I've checked SO but everything (answers) seem so incomplete. I checked YT tutorials (i've found some fishy ones), there is also one repo on Github https://github.com/pekka2/OpenCart-Migration-Upgrade-Tool .could this be part of the solution? – AlFra Jun 04 '16 at 10:37
  • None at all, I'm afraid - it doesn't enjoy [a spectacular reputation](https://www.reddit.com/r/PHP/comments/250qjd/why_you_should_never_use_opencart_personal/) and I'd be wary of using it. Is there an importer in 2.0? Failing that you could set up a fresh instance of 2.x, create some products, and then examine the database format - maybe you can write your own migration script? – halfer Jun 04 '16 at 10:47
  • i will try to use that migration script from GitHub. I shall see if that does anything useful. – AlFra Jun 04 '16 at 10:52
0

Just to mention it, my OpenCart v.1.5.6.5_rc work well with PHP v.7.015 so far. I only had to upgrade the OpenShop Extension bypacked Sql-Buddy, and the eXtplorer File Editor, to make everything work well again.

And all OpenCart v.1.5.6.0 - 1.5.6.5_rc have a Selection Box, to select between 4 different DB Drivers, including msqli

And regarding OpenCart v.2.3.x, the latest Version OC v.3.0 already exists on Github.com, and soon, not many Dev's will care anymore anymore about those many unfinished and already outdated V.2.x versions, I assume.

But OC v.3.0 is an entirely new (TWIG-supported) Theme Design, technically at least. So, one will no longer be able, to use any of the so far existing v.1.x - v.2.x Themes and probably Extensions anymore. Just be aware of such, before possible destroying the still most reliable working OpenCart v.1.5.6.x Version on your Server.

Nayana_Das
  • 1,789
  • 4
  • 23
  • 48