Function mcrypt_get_iv_size() is deprecated

  • | 778 points

    I'm quite new to Laravel and my first project was to clone from a git repository. Then I executed composer install after that and got this error when i tried accessing the project with the browser.

    ErrorException (E_DEPRECATED)

    Function mcrypt_get_iv_size() is deprecated
    Open: C:\laragon\www\projectAvocado\vendor\laravel\framework\src\Illuminate\Encryption\Encrypter.php

     * Update the block size for the current cipher and mode.
     * @return void
    protected function updateBlockSize()
    	$this->block = mcrypt_get_iv_size($this->cipher, $this->mode);

    I browsed StackEx which is here and they recommend editing cipher to "AES-256-CBC" instead of the default 'cipher' => MCRYPT_RIJNDAEL_128, but I get errors on that too. Looks like AES-256-CBC could not be recognized?

  • administrators
    | 131219 points

    @Abigail-Banquil : Which github repo did you clone?
    Did you try to generate a new key

    php artisan key:generate

  • | 778 points


    I got it working now.

    php artisan key:generate

    did not work because it detects AES-256-CBC as invalid.

    I got it working by
    Changing PHP version to 7.0 instead of 7.1

Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.