我已将laravel 5.3升级到laravel 5.5并且我使用的是php 7.1.11
升级时出现错误
ErrorException (E_ERROR) Function mcrypt_get_iv_size() is deprecated
在config\app
我有
'cipher' => 'AES-256-CBC'
还尝试添加
error_reporting(E_ALL ^ E_DEPRECATED);
但它仍然出错。
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, self::$skey, $text, MCRYPT_MODE_ECB, $iv);
这是我正在使用它的代码。
答案 0 :(得分:0)
你可以检查一下 https://github.com/laravel/framework/issues/16329 要么 https://github.com/laravel/framework/issues/16884(我的问题解决了这个链接 - 对于Laravel 4.2)