简体   繁体   中英

Undefined constant "MCRYPT_RIJNDAEL_128" in codeIgniter PHP 8.0

I am upgrading php 7.x to 8.0 in CodeIgniter in local wamp server in windows 10. I found this error:-

Message: Undefined constant "MCRYPT_RIJNDAEL_128"

My code is like this:-

$password = trim(openssl_encrypt(MCRYPT_RIJNDAEL_128, $key, $encrypted, MCRYPT_MODE_CBC, $iv), "\0..\32");

Error display like this:- 在此处输入图像描述

From php.net:

This extension has been moved to the » PECL repository and is no longer bundled with PHP as of PHP 7.2.0

You can try install mcrypt extension via pecl. In my case it's Ubuntu:

pecl install mcrypt

For windows

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM