[SOLVED]: Laravel 5 Error “Undefined function Illuminate\Encryption\openssl_cipher_iv_length()”

After updating to Laravel versions 5.5 and 5.6 following an upgrade of PHP from v5.6 to v7.2, I experienced the following Laravel error:

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Call to undefined function Illuminate\Encryption\openssl_cipher_iv_length()

The function openssl_cipher_iv_length is a part of the OpenSSL PHP library, and most instances of this error seem to be fixed by uncommenting out the the extension in php.ini.

However, in my case, the extension was uncommented and I still got this error. After checking with phpinfo(), however, it turned out that OpenSSL wasn’t active on the PHP installation!

I later discovered that, since I am running on windows,  I had not included the two OpenSSL DLLs libeay32.dll and ssleay32.dll in the PHP 7.2 directory. After copying these from the old PHP installation and restarting the server. OpenSSL was reported as functioning by PHPInfo and the Laravel openssl_cipher_iv_length error vanished.

So if you have this problem, your PHP OpenSSL extension is not working, for one reason or another!

Leave a Reply

Your email address will not be published. Required fields are marked *