Page 1 of 1

Is OpenCart 1.5.6 compatible to MySQL 5.7

Posted: Thu Oct 06, 2022 12:21 am
by rudolphmaria
Hello,
I have to move an OpenCart 1.5.6 shop running on PHP 7.2 and MySQL 5.6 to a new server using MySQL 5.7. Before I do this I want to make sure that there are no incompatiblilties with MySQL 5.7. I have searched for it on this forum and on the web but found neither "it work's" nor "it doesn't work". Does anyone here have any experiences with this?
Regards, Rudolph

Re: Is OpenCart 1.5.6 compatible to MySQL 5.7

Posted: Thu Oct 06, 2022 12:28 am
by johnp
rudolphmaria wrote:
Thu Oct 06, 2022 12:21 am
Hello,
I have to move an OpenCart 1.5.6 shop running on PHP 7.2 and MySQL 5.6 to a new server using MySQL 5.7. Before I do this I want to make sure that there are no incompatiblilties with MySQL 5.7. I have searched for it on this forum and on the web but found neither "it work's" nor "it doesn't work". Does anyone here have any experiences with this?
Regards, Rudolph
Why not clone your site and database and try running it on MySQL 5.7. You'll soon know if it works.

Re: Is OpenCart 1.5.6 compatible to MySQL 5.7

Posted: Thu Oct 06, 2022 12:20 pm
by OSWorX
rudolphmaria wrote:
Thu Oct 06, 2022 12:21 am
Hello,
I have to move an OpenCart 1.5.6 shop running on PHP 7.2 ..
Please, forget php 7.x - is end of life this year!
Only php 8.x should be used - why, search this forum (few post about why to use 8.x over 7.x)

Re: Is OpenCart 1.5.6 compatible to MySQL 5.7

Posted: Thu Oct 06, 2022 6:57 pm
by rudolphmaria
Thanks for your replies.
As far as I have researched OpenCart 1.5.6 doesn't run with any PHP above 7.2. So I have to stick with PHP 7.2. Although EoL it will be available on the server for a much longer time.
I would set up OpenCart 1.5.6 with MySQL 5.7 for testing on the current server. Unfortunately 5.7 is NOT available. Only on the new server.
Is there anyone out there who has set up OpenCart 1.5.6 with MySQL 5.7 and can tell me if there are any incompatibilities? Your help is much appreciated!!!
Regards, Rudolph

Re: Is OpenCart 1.5.6 compatible to MySQL 5.7

Posted: Thu Oct 06, 2022 7:34 pm
by johnp
rudolphmaria wrote:
Thu Oct 06, 2022 6:57 pm
Thanks for your replies.
As far as I have researched OpenCart 1.5.6 doesn't run with any PHP above 7.2. So I have to stick with PHP 7.2. Although EoL it will be available on the server for a much longer time.
I would set up OpenCart 1.5.6 with MySQL 5.7 for testing on the current server. Unfortunately 5.7 is NOT available. Only on the new server.
Is there anyone out there who has set up OpenCart 1.5.6 with MySQL 5.7 and can tell me if there are any incompatibilities? Your help is much appreciated!!!
Regards, Rudolph
Set up a clean install of OC on the new server. You'll easily see if there are any problems. I suggest using the 1.5.6.5 version. I have it running on PHP 7.4:

https://github.com/condor2/Opencart-1.5.6.5_RC

If you have a pretty clean installation with little or no extensions consider upgrading to a later OC version.

Re: Is OpenCart 1.5.6 compatible to MySQL 5.7

Posted: Thu Oct 06, 2022 11:30 pm
by rudolphmaria
Upgrading OC unfortunately is not an option as it has been massively customized. Testing on a virtual server didn't work as it didn't offer the combination of PHP 7.2 and MySQL 5.7. The new server is part of an upgrade and will only be accessible after the shop has been transferred. Hmm...
So I'm looking for someone out there who has set up OpenCart 1.5.6 with MySQL 5.7 and can tell me if there are any incompatibilities?
Regards, Rudolph

Re: Is OpenCart 1.5.6 compatible to MySQL 5.7

Posted: Thu Oct 06, 2022 11:48 pm
by johnp
rudolphmaria wrote:
Thu Oct 06, 2022 11:30 pm
Upgrading OC unfortunately is not an option as it has been massively customized. Testing on a virtual server didn't work as it didn't offer the combination of PHP 7.2 and MySQL 5.7. The new server is part of an upgrade and will only be accessible after the shop has been transferred. Hmm...
So I'm looking for someone out there who has set up OpenCart 1.5.6 with MySQL 5.7 and can tell me if there are any incompatibilities?
Regards, Rudolph
Set me up a test account on your new server and I'll upload a copy and give it a go. As for customization. I'm sure what you've had done on your 1.5.6.4 site can be replicated on say 2.3.0.2.

Re: Is OpenCart 1.5.6 compatible to MySQL 5.7

Posted: Fri Oct 07, 2022 12:45 am
by johnp
Just checked a couple of my client's sites. They're running OC 1.5.6.5 on PHP 7.4 and MySQL 5.7.39 with no problems. They won't run on PHP 8.

Re: Is OpenCart 1.5.6 compatible to MySQL 5.7

Posted: Fri Oct 07, 2022 1:36 am
by IP_CAM
Encryption.php File, to make make v.1.5.6.5 installable with PHP v.7.4.30 Versions :
https://www.opencart.com/index.php?rout ... n_id=38012

Re: Is OpenCart 1.5.6 compatible to MySQL 5.7

Posted: Fri Oct 07, 2022 1:39 am
by johnp
Just had a play. I've got this version running on PHP 8.0 and MySQL 5.7.23-23:

https://github.com/IP-CAM/Opencart-v.1. ... 29-Version

It runs on PHP 8.1 but shows a rounding error in /catalog/model/catalog/product.php on line 50

Removing the round function stops this error. Have also installed Vqmod 2.6.6 and Vqmod Manager.

Re: Is OpenCart 1.5.6 compatible to MySQL 5.7

Posted: Fri Oct 07, 2022 2:32 am
by IP_CAM
I also have two other encryption.php files, and both of them work:

Code: Select all

first
-----

<?php
final class Encryption {
	private $key;
	private $iv;
	
	public function __construct($key) {
		$this->key = $key;
	}
	
	public function encrypt($value) {
		return strtr(base64_encode(openssl_encrypt($value, 'aes-128-cbc', hash('sha256', $this->key, true))), '+/=', '-_,');
	}
	
	public function decrypt($value) {
		return trim(openssl_decrypt(base64_decode(strtr($value, '-_,', '+/=')), 'aes-128-cbc', hash('sha256', $this->key, true)));
	}
}
?>

--------------------------------------------------------------------
second
--------

<?php
final class Encryption {
	
	private $cipher = 'aes-256-ctr';
	private $digest = 'sha256';
	private $key;
	
	public function __construct($key) {
		$this->key = $key;
	}

	public function encrypt($value) {
		$key       = openssl_digest($this->key, $this->digest, true);
		$iv_length = openssl_cipher_iv_length($this->cipher);
		$iv        = openssl_random_pseudo_bytes($iv_length);
		return base64_encode($iv . openssl_encrypt($value, $this->cipher, $key, OPENSSL_RAW_DATA, $iv));
	}
	
	public function decrypt($value) {
		$key       = openssl_digest($this->key, $this->digest, true);
		$iv_length = openssl_cipher_iv_length($this->cipher);
		$value     = base64_decode($value);
		$iv        = substr($value, 0, $iv_length);
		$value     = substr($value, $iv_length);
		return openssl_decrypt($value, $this->cipher, $key, OPENSSL_RAW_DATA, $iv);
	}
}
?>

Re: Is OpenCart 1.5.6 compatible to MySQL 5.7

Posted: Fri Oct 07, 2022 3:17 am
by johnp
Just noticed on my test site you can't checkout.

Re: Is OpenCart 1.5.6 compatible to MySQL 5.7

Posted: Fri Oct 07, 2022 4:23 am
by johnp
I've installed the OC Bootstrap Pro theme and it now works fine.

https://www.opencart.com/index.php?rout ... n_id=15752

Re: Is OpenCart 1.5.6 compatible to MySQL 5.7

Posted: Fri Oct 07, 2022 4:57 am
by IP_CAM
Fine, because they both work in two of my bootstrap themed Installs.

Re: Is OpenCart 1.5.6 compatible to MySQL 5.7

Posted: Fri Oct 07, 2022 5:17 am
by johnp
With the upgrade and bootstrap theme 1.5.6.4 store owners should get a bit more life from their store. :)