Reputation: 348
I'm setting Laravel 5.7 on Apache 2.4 using PHP 7.1.26. I configured everything like documentations. But I'm getting the error below:
Call to undefined function Illuminate\Encryption\openssl_cipher_iv_length()
I've already change PHP version to 7.2 and nothing. I've already copied the file libeay32.dll to Apache and nothing
These are my modules in PHP
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
gd
gettext
gmp
hash
iconv
imap
intl
json
ldap
libxml
mbstring
mcrypt
mysqli
mysqlnd
odbc
openssl
pcre
PDO
PDO_ODBC
pdo_pgsql
pdo_sqlite
pgsql
Phar
readline
Reflection
session
SimpleXML
soap
sockets
SPL
standard
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib
Upvotes: 2
Views: 12657
Reputation: 1243
Just Run composer update
command from laravel installation directory
And make sure extension=php_openssl.dll is enabled in php.ini
Restart Apache Server...
Enjoy :)
Upvotes: 2
Reputation: 51
I've just found there is a case I have to set a full path for PHP extension in php.ini
.
When I executed PHP manually, it loaded extensions properly, but when it's via apache, it tried to load from the wrong path.
extension_dir = "C:\full path for PHP ext\ext"
Upvotes: 5
Reputation: 53563
openssl_cipher_iv_length()
is a standard PHP function from the OpenSSL module. Your error message says:
undefined function Illuminate\Encryption\openssl_cipher_iv_length()
Note how the function name is preceded by Illuminate\Encryption
-- this indicates that PHP thinks the function is located in the Illuminate\Encryption
namespace, but it's not. To fix this, you can explicitly associate the function call to the root namespace by prefixing it with a backslash:
\openssl_cipher_iv_length()
This error could also mean that openssl_cipher_iv_length()
is simply not available anywhere, and the Illuminate\Encryption
namespace is just the last place that it looked. In this case, you'll need to ensure you have the OpenSSL module installed -- but note that the command line config is different than the embedded web server config. I.e., running php -m
from the command line might report that OpenSSL is available, but it might not be loaded for the web server version. So run phpinfo()
inside a page served by your web server to verify that OpenSSL is indeed loaded.
Upvotes: 2