PHP7.1和Laravel 5.3:不推荐使用函数mcrypt_get_iv_size() [英] PHP7.1 and Laravel 5.3: Function mcrypt_get_iv_size() is deprecated

查看:1258
本文介绍了PHP7.1和Laravel 5.3:不推荐使用函数mcrypt_get_iv_size()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在所有项目中都使用Laravel 5.0.昨天,我将PHP版本从7.0.x更新到了7.1.0.更新后,我尝试打开我的Laravel项目,并在下面看到此消息:

I'm using Laravel 5.0 for all my projects. Yesterday, I've updated my PHP version from 7.0.x to version 7.1.0. Once updated, I tried opening my Laravel project and saw this message below:

ErrorException in Encrypter.php line 303: 
Function mcrypt_get_iv_size() is deprecated

in Encrypter.php line 303
at HandleExceptions->handleError('8192', 'Function mcrypt_get_iv_size() is deprecated', 'C:\wamp64\www\project1\vendor\laravel\framework\src\Illuminate\Encryption\Encrypter.php', '303', array()) in Encrypter.php line 303

我可以知道如何解决这个问题吗?使用Laravel 5.3是否可以解决问题?我不希望将Laravel更新到5.3,因为这是一个巨大的项目,并且需要很长时间才能更新.这两个版本之间有太多差异.许多代码需要修改.

May I know how can I solve this ? Does using Laravel 5.3 solve the problem? I don't feel like updating my Laravel to 5.3 because it's a huge project and it will takes a long time to update. There are too much differences between these two versions. Lots of codes need to be modified.

有没有更简单的方法来解决此问题?

Is there an easier way to solve this issue?

推荐答案

发生此错误的原因是,您的config/app.php文件中的密码可能取决于AES-256-CBC以外的其他内容,具体取决于mcrypt扩展名.也许您正在使用MCRYPT_RIJNDAEL_256MCRYPT_RIJNDAEL_128?

This error occurs because you probably have something other than AES-256-CBC as your cipher in your config/app.php file that depends on the mcrypt extension. Perhaps you are using MCRYPT_RIJNDAEL_256 or MCRYPT_RIJNDAEL_128?

如果不进行全面的Laravel升级,最好的办法是安装传统加密器我相信,并使用它来更新所有加密数据,以使用AES-256-CBC密码,该密码自Laravel 5.1以来就是默认密码.完成此操作后,您应该可以在Laravel应用程序中使用PHP 7.1.

The best thing you can do without a full-blown Laravel upgrade is install the legacy encrypter and use it to update all your encrypted data to use the AES-256-CBC cipher which has been the default cipher since Laravel 5.1, I believe. Once you do this, you should be able to use PHP 7.1 for your Laravel application.

这篇关于PHP7.1和Laravel 5.3:不推荐使用函数mcrypt_get_iv_size()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆