简体   繁体   English

codeIgniter PHP 8.0 中未定义的常量“MCRYPT_RIJNDAEL_128”

[英]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:-我在 windows 10 的本地 wamp 服务器中的 CodeIgniter 中将 php 7.x 升级到 8.0。我发现了这个错误:-

Message: Undefined constant "MCRYPT_RIJNDAEL_128"消息:未定义的常量“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:来自 php.net:

This extension has been moved to the » PECL repository and is no longer bundled with PHP as of PHP 7.2.0此扩展已移至 » PECL 存储库,自 PHP 7.2.0 起不再与 PHP 捆绑

You can try install mcrypt extension via pecl.您可以尝试通过 pecl 安装 mcrypt 扩展。 In my case it's Ubuntu:就我而言,它是 Ubuntu:

pecl install mcrypt

For windows适用于 windows

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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