My environment:
- XAMPP Version 7.2.8
- PHP 7.2.8 (this was installed together when the XAMPP was installed.)
- Apache 2.4.34 (this was installed together when the XAMPP was installed.)
I am new to Laravel. I made Laravel project folder and executed the command php artisan key:generate
to generate app_key.
but I got the error below:
PHP Warning: PHP Startup: Unable to load dynamic library 'mcrypt' (tried: C:\xampp\php\ext\mcrypt, C:\xampp\php\ext\php_mcrypt.dll) in Unknown on line 0
I checked mcrypt
is loaded by following code.
<?php
if(function_exists('mcrypt_encrypt')) {
echo "mcrypt is loaded!";
} else {
echo "mcrypt isn't loaded!";
}
?>
and it answered "mcrypt isn't loaded!"
.
So, I did as below following this instruction to add mcrypt
.
I downloaded php-5.2.1-Win32
from this webpage. and copied
libmcrypt.dll
and php_mcrypt.dll
in that php version to the ext folder in mine.
and I edited php.ini file as below.
for checking the location of php.ini, I use phpinfo()
.
and restarted Apache and tried to check if mcrypt is loaded by the program above. But the result was "mcrypt isn't loaded!".
I also tried to change the way to write in php.ini file as below:
but the result was the same: "mcrypt isn't loaded!".
I also tried to check if openssl
is enabled by php -r "echo OPENSSL_VERSION_TEXT;"
. but the error occurred as follows:
Warning: PHP Startup: Unable to load dynamic library 'mcrypt' (tried: C:\xampp\php\ext\mcrypt
so, I commented out mcrypt extension in php.ini. "php -r "echo OPENSSL_VERSION_TEXT;"" worked resulting "OpenSSL 1.1.0h 27 Mar 2018".