PHP7.1 and Laravel 5.3: Function mcrypt_get_iv_size() is deprecated

前端 未结 4 1602
一向
一向 2020-12-25 10:25

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 thi

相关标签:
4条回答
  • 2020-12-25 11:00

    to solve this just change cipher in app.php from 'MCRYPT_RIJNDAEL_128' to 'AES-256-CBC'

    0 讨论(0)
  • 2020-12-25 11:06

    In your config/app.php configuration file, you should update the cipher to "AES-256-CBC" and set your key to a random 32 byte string which may be securely generated using php artisan key:generate

    0 讨论(0)
  • 2020-12-25 11:07

    Add this to the beginning of the config/app.php:

    error_reporting(E_ALL ^ E_DEPRECATED);

    Source: https://stackoverflow.com/a/42515505/225790

    0 讨论(0)
  • 2020-12-25 11:09

    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?

    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.

    0 讨论(0)
提交回复
热议问题