Post by sander23 » Mon Jan 29, 2018 6:56 pm

Hi guys,
I have 1.5.5.1 and now migrating to VPS, i'm outsourcing the transition to the hosting staff, but they say the latest php version that works fine is 5.4.

I would like to have the newset version of course, I haven't done my homework about this stuff but I suppose it would be best to have the newset php version, right? :) Why wouldn't it work on never versions? Do you have any experience?

Thanks so much
Much love

Sander

Active Member

Posts

Joined
Fri Apr 27, 2012 9:16 am

Post by villagedefrance » Mon Jan 29, 2018 10:17 pm

Hi Sander,

None of the OC 1.5.+ versions are compatible with PHP 7.
As you know since you have done your research, there is no PHP 6, so the best PHP version for OC 1.5.+ is PHP 5.6.+.
The reason is that PHP 7 (and PHP 7.1 even more!) has evolved considerably and many key functions have since been deprecated.
To use OC 1.5.5.1 you should stay with PHP 5.6.+ for stability, but my advice is to consider upgrading to a newer version.
Alternatively, check my website (link in signature) if you need a PHP 7.1 compatible version.

OpenCart custom solutions @ https://villagedefrance.net


User avatar
Active Member

Posts

Joined
Wed Oct 13, 2010 10:35 pm
Location - UK

Post by dachiaru » Tue Jan 30, 2018 1:39 am

villagedefrance wrote:
Mon Jan 29, 2018 10:17 pm
Hi Sander,

None of the OC 1.5.+ versions are compatible with PHP 7.
As you know since you have done your research, there is no PHP 6, so the best PHP version for OC 1.5.+ is PHP 5.6.+.
The reason is that PHP 7 (and PHP 7.1 even more!) has evolved considerably and many key functions have since been deprecated.
To use OC 1.5.5.1 you should stay with PHP 5.6.+ for stability, but my advice is to consider upgrading to a newer version.
Alternatively, check my website (link in signature) if you need a PHP 7.1 compatible version.
Hi, i have tested your version on php 7.1, there is a problem with module amazon /system/library/amazon.php and istruction deprecated mcrypt_ line 364 >...

Consulenza informatica. Soluzione web su misura. Creazione siti web. Creazione soluzioni eCommerce avanzate opencart, joomla, wordpress. Creazione extension. Ottimizzazione SEO, servizio posizionamento web professionale e garantito.
INFO SITI: https://www.masterwebsite.it
CONTATTO SKYPE: masterwebsite.it


User avatar
Active Member

Posts

Joined
Mon Oct 22, 2012 5:39 pm
Location - Roma

Post by sander23 » Tue Jan 30, 2018 3:35 am

@Villagedefrance thanks for your response mate. I have considered upgrading to some newer version a bunch of times, but I always abandon the idea when I consider how many extensions I've got running (around 30-40) and all the energy that was invested into establishing a system that suits all of our needs. Now, who knows how many of those extensions got updated for the newer versions or if there exist any alternatives for them that would work on newer versions. It seems too big of a project and always scares me off.

I took a look on your website and this overclocked 1.5 version seems a nice solution, but there is still the question if the extensions would work on this version, what do you think? And also, is upgrading to this overclocked version from 1.5.5.1 easy, and what would it require? Would everything else apart the extensions stay the same, or is there much work and adjustments to be done?

Thanks and much love
Sander

Active Member

Posts

Joined
Fri Apr 27, 2012 9:16 am

Post by IP_CAM » Tue Jan 30, 2018 5:44 am

Well, at least later OC v.1.5.6.x Versions seem to have no problem, at least up to PHP 7.0.x
but by use of PHP 7.1, they refuse to further work. Exept for the OC installation Routine, and a
Filemanager Admin Tool, as I found out so far, required to be modified, since PHP 7 does no
longer handle MySql, but only MySqli
https://www.opencart.com/index.php?rout ... n_id=20624
Ernie
---
Image

Attachments

oc_156x_php7.jpg

oc_156x_php7.jpg (58.85 KiB) Viewed 4078 times


I don't use Forum Mail, to reach me, contact: jti@jacob.ch
-
Server Q & A Basic Information on Code + Settings
http://www.everyauction.info/serverinfo.html
Demoversion OpenCart LIGHT v.1.5.6.5
http://www.jti.li/shop/
1'400+ FREE OC Extensions - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
-
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by thomash2 » Tue May 29, 2018 10:21 am

I previously fixed an older 1.5x for PHP 5.6. But I see that security support for 5.6 will end in December 2018.
http://php.net/supported-versions.php

I was thinking about migrating to 1.5.6x since Ernie says it works with PHP 7.0, but the same page says 7.0 will also end in December 2018.

So I wonder how much longer after December will it still work, depending on the hosting providers decision to stop using the older versions of PHP. I have a lot of vqmods to get around problems mainly for EU required stuff, mostly for correct calculations and displaying of VAT prices, default shipping costs, and product options, and it would take a lot of effort to try making them work with the newest versions of OC. Or does OC 3.x fix some of these requirements?

New member

Posts

Joined
Tue Jul 30, 2013 12:44 am

Post by IP_CAM » Tue May 29, 2018 11:10 am

Well, OC v.1.5.6.4+ already works up to PHP v.7.1.x Versions well, after replacing
the default system/library/encryption.php file with this one, sponsored a short
while ago by a fine Contributor. It even worked with PHP 7.2.x, but I run into a widely
known software (Counting) error message, all related to PHP 7.2.x, somewhere, and did not
bother since, to further check on this PHP matter.

Code: Select all

<?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);
	}
}
?>
But, to tell you a secret, my Testshop even works by use of Villagedefrance latest Version release
system/library/encryption.php file as it looks, I so far found no problem, up to PHP 7.1.16 :D
Ernie

Code: Select all

<?php
final class Encryption {
	private $key;

	public function __construct($key) {
		$this->key = hash('sha256', $key, true);
	}

	public function encrypt($value) {
		$php_version = phpversion();

		if ($php_version >= '7.1') {
			$method = 'AES-128-CBC';

			$iv_length = openssl_cipher_iv_length($method); // 16

			$iv = openssl_random_pseudo_bytes($iv_length);

			$encrypted = openssl_encrypt($value, $method, hash('sha256', $this->key, true), OPENSSL_RAW_DATA, $iv);

		} else {
			$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);

			if ($php_version >= '5.6') {
				$iv = mcrypt_create_iv($iv_size, MCRYPT_DEV_URANDOM);
			} elseif ($php_version >= '5.3') {
				$iv = mcrypt_create_iv($iv_size, MCRYPT_DEV_RANDOM);
			} else {
				$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
			}

			$encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, hash('sha256', $this->key, true), $value, MCRYPT_MODE_CBC, $iv);
		}

		$encoded = base64_encode($encrypted) . '|' . base64_encode($iv);

		return strtr($encoded, '+/=', '-_,');
	}

	public function decrypt($value) {
		$php_version = phpversion();

		$value = explode('|', strtr($value, '-_,', '+/=') . '|');

		$decoded = base64_decode($value[0]);

		$iv = base64_decode($value[1]);

		if ($php_version >= '7.1') {
			$method = 'AES-128-CBC';

			$decrypted = trim(openssl_decrypt($decoded, $method, hash('sha256', $this->key, true), OPENSSL_RAW_DATA, $iv));

		} else {
			$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);

			if (strlen($iv) !== $iv_size) {
				return false;
			}

			$decrypted = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, hash('sha256', $this->key, true), $decoded, MCRYPT_MODE_CBC, $iv));
		}

		return $decrypted;
	}
}
?>
Image

Attachments

oc_1565_php_7_1_x.jpg

Villagedefrance's encryption.php file in action - oc_1565_php_7_1_x.jpg (47.02 KiB) Viewed 3795 times


I don't use Forum Mail, to reach me, contact: jti@jacob.ch
-
Server Q & A Basic Information on Code + Settings
http://www.everyauction.info/serverinfo.html
Demoversion OpenCart LIGHT v.1.5.6.5
http://www.jti.li/shop/
1'400+ FREE OC Extensions - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
-
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by laco1234 » Mon Apr 15, 2019 6:20 pm

Opencart 1.5.6.1 Failed to write session data (memcache)

I am still using Opencart 1.5.6.1 with MariaDB 10.1 and PHP 7.3 and current Vqmod with no custom template and almost any extensions, just switch to MySqli posted by IP_CAM , that work perfektly.

After upgrading to PHP 7.3 everithing work ok but from time to time I am getting this warning:
2019-04-12 21:16:07 - PHP Warning: Unknown: Failed to write session data (memcache). Please verify that the current setting of session.save_path is correct (/apachetmp/sessions) in Unknown on line 0

I doesn't succeed induce this warning by myself just by browsing or admin or eshop or making orders. It seams it caused sometimes by end visitors. Is this hosting problem or it means that memcache does not work properly with PHP 7.3 ?

Thank you a lot. I dont want upgrade since I like the old opencart tmeme design and grayish colors .

Newbie

Posts

Joined
Mon Apr 15, 2019 5:43 pm

Post by IP_CAM » Mon Apr 15, 2019 8:26 pm

Check Google on this, Memcache seems to have a Problem with latest PHP Version.
https://www.google.com/search?q=memcach ... 8&oe=utf-8

I don't use Forum Mail, to reach me, contact: jti@jacob.ch
-
Server Q & A Basic Information on Code + Settings
http://www.everyauction.info/serverinfo.html
Demoversion OpenCart LIGHT v.1.5.6.5
http://www.jti.li/shop/
1'400+ FREE OC Extensions - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
-
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: Bing [Bot] and 54 guests