Post by masroorejaz » Fri Jun 23, 2023 6:37 pm

Hello,

I have moved my opencart 2.0.1.0 website http://tacticalapparels.com/ from another server.

I have zipped and unzipped all the files from previous server and link the database as well.

I am using Journal 2.6.5 theme. All is working fine except when I am trying to access admin panel it's redirect me to https://tacticalapparels.com/install/index.php

My previous admin panel folder name was different and it's was working fine. I even renamed back to admin but the problem is still here.

I have checked mostly all the .htaccess file. Clear vqcache and journal cache but issue is still there.

Kindly provide me the solution on how to resolve this step by step.

Thank you.

Newbie

Posts

Joined
Fri Jun 23, 2023 6:25 pm

Post by ADD Creative » Fri Jun 23, 2023 10:18 pm

Do you have a config.php in your admin directory with correct permissions? Does it have all the correct defines including DIR_APPLICATION?

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by masroorejaz » Sat Jun 24, 2023 5:34 pm

It has 755 permission.
I think it might something have to do with mcrypt extension since I am currently using PHP 7.3 and mcrypt is depreciated in it.

Newbie

Posts

Joined
Fri Jun 23, 2023 6:25 pm

Post by ADD Creative » Sat Jun 24, 2023 9:07 pm

This is what I use for system/library/encryption.php.

Code: Select all

<?php
final class Encryption {
	private $key;

	public function __construct($key) {
		$this->key = $key;
	}

	public function encrypt($value) {
		if (version_compare(PHP_VERSION, '7.1', '>=')) {
			$iv = random_bytes(openssl_cipher_iv_length('aes-256-gcm'));
			$tag = '';

			$encrypted = openssl_encrypt($value, 'aes-256-gcm', hash('sha256', $this->key, true), OPENSSL_RAW_DATA, $iv, $tag);
	 
			return strtr(base64_encode($iv . $tag . $encrypted), '+/=', '-_,');
		} else {
			trigger_error('Insecure encryption used, PHP 7.1 or above required', E_USER_ERROR);

			return strtr(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, hash('sha256', hash('sha256', $this->key, true), true), $value, MCRYPT_MODE_ECB)), '+/=', '-_,');
		}
	}

	public function decrypt($value) {
		if (version_compare(PHP_VERSION, '7.1', '>=')) {
			$encrypted = base64_decode(strtr($value, '-_,', '+/='));

			$iv_len = openssl_cipher_iv_length('aes-256-gcm');
			$tag_len = 16;

			if (strlen($encrypted) <= $iv_len + $tag_len) {
				return '';
			}

			$iv = substr($encrypted, 0, $iv_len);
			$tag = substr($encrypted, $iv_len, $tag_len);

			return trim(openssl_decrypt(substr($encrypted, $iv_len + $tag_len), 'aes-256-gcm', hash('sha256', $this->key, true), OPENSSL_RAW_DATA, $iv, $tag));
		} else {
			trigger_error('Insecure decryption used, PHP 7.1 or above required', E_USER_ERROR);

			return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, hash('sha256', hash('sha256', $this->key, true), true), base64_decode(strtr($value, '-_,', '+/=')), MCRYPT_MODE_ECB));
		}
	}
}

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by masroorejaz » Sat Jun 24, 2023 9:17 pm

I switch to PHP 5.6 with Mcrypt extension installed and enable but the problem is still there.

Even worst when I tried to install Opencart 2.0.1.0 with same setting and on same server but on different domain, it get the installation done. But CSS was completely missing from both customer and admin end.

Kindly help.

Newbie

Posts

Joined
Fri Jun 23, 2023 6:25 pm
Who is online

Users browsing this forum: No registered users and 3 guests