Call to undefined function mcrypt_encrypt() (v. 2.82 - 2.83)
If you receive the error:
Fatal error: Call to undefined function mcrypt_encrypt() in /home/user/public_html/storeadmin/includes/passencr.php on line 7
This means that your host is either using an older version of PHP, or they do not have the mcrypt library installed. You will need to do one of the following:
-
Ask your web host to upgrade PHP if the version is older than 4.0.2 and install the mcrypt library if it is not installed (recommended)
- OR -
-
Manually modify the passencr.php file in the /includes/ folder of the /storeadmin/ folder as follows:
-
Open the passencr.php file in the /includes/ folder of the /storeadmin/ folder.
-
Change the line:
$decval = trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, SB_PASS_SALT, $encval, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
to:
if(extension_loaded('mcrypt')) $decval = trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, SB_PASS_SALT, $encval, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)))); else $decval = trim(base64_encode(SB_PASS_SALT .$encval)); -
Change the line:
$encval = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, SB_PASS_SALT, base64_decode($decval), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));
to:
if(extension_loaded('mcrypt')) $encval = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, SB_PASS_SALT, base64_decode($decval), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))); else $encval = str_replace(SB_PASS_SALT, '', trim(base64_decode($decval)));
-