Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Function mcrypt_get_iv_size() is deprecated in Laravel 4.2 on MAMP running PHP 7.1.0

I've just upgraded my MAMP server to run 7.1.0. I'm now getting this error with my Laravel 4.2 installations;

Function mcrypt_get_iv_size() is deprecated 

I've tried changing

'cipher' => MCRYPT_RIJNDAEL_128,

to

'cipher' => 'AES-256-CBC',

but to no avail.

Does anyone know how to get around this issue in Laravel 4.2?

Not a duplicate as explained in the comments.

like image 359
Jordan D Avatar asked Feb 03 '17 12:02

Jordan D


1 Answers

You should upgrade you laravel project. mcrypt is deprecated in php 7.1.

You can just disable deprecated warning in your php configuration (or add @ before any mcrypt function), if you don't have time to upgrade.

Be carefull ! it will be completly removed in 7.2+

Edit: for php 7.2, it's removed in the core, but you can add mcryt as a pecl extension.

like image 93
neoteknic Avatar answered Sep 22 '22 05:09

neoteknic