19

I am using xampp and windows along with laravel, everything was working fine, but when I finished work and turned of xampp and try to open my work today morning, this is what I get:

FatalThrowableError in Encrypter.php line 100:
Fatal error: Call to undefined function Illuminate\Encryption\openssl_decrypt()

Encrypter.php is a standard laravel file and I have not even touched it. My extension is turned on.

extension=php_openssl.dll

What might be wrong?

Scott Arciszewski
  • 33,610
  • 16
  • 89
  • 206
Przemek Wojtas
  • 1,311
  • 5
  • 26
  • 51
  • It looks like the method Illuminate\Encryption\openssl_decrypt is not reachable or being loaded. Have you done something with the autoloader? – xarlymg89 Mar 22 '16 at 14:05
  • Nope I have not even touched autoloader, trust me it was working fine before I shut xampp down and next time when I ran it this is what I get – Przemek Wojtas Mar 22 '16 at 14:10
  • I trust you ^^ Just highlithing the fact that if a function is undefined, is because is not being loaded. If you are sure that the extension is being loaded, then the only thing that's possible to be the failing point, is the loading of the file. Try verifying the reading permissions of that file or the folders above it. – xarlymg89 Mar 22 '16 at 14:19
  • So how would I do that? – Przemek Wojtas Mar 22 '16 at 14:23

6 Answers6

22

Just edit php.ini file and uncomment by removing ";" before this line --extension=openssl. in php.ini file. and it will start working properly.

user13654068
  • 221
  • 2
  • 2
17

If you have shut XAMPP down and restarted it, it may be worth running the composer install command again, or simply running composer update to ensure that all dependancies are being loaded correctly.

guyver4mk
  • 609
  • 6
  • 11
  • Hmm seems like there is a problem: cannot update or install apparently these files cannot be found. one of them is the one I get error message – Przemek Wojtas Mar 22 '16 at 14:29
  • There you have your error, you cannot find the files, then obviously the files aren't being loaded. – xarlymg89 Mar 22 '16 at 14:33
  • Yeap exactly, I have specified exact location of these files so C:\\xampp\php\ext and works fine, got another problem with database to fix haha – Przemek Wojtas Mar 22 '16 at 14:34
  • I even hadn't the composer installed, fixed after installation, thanks – Winner1 Jul 23 '19 at 13:41
8

Modify php.ini and enable openssl extension in you php environment.

To find php installation path, run below command in terminal or cmd

php --ini

Output something like below:

Configuration File (php.ini) Path: C:\Windows
Loaded Configuration File:         C:\php-7.3.8\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

here mine is Loaded Configuration File is C:\php-7.3.8\php.ini

open php.ini with any editor using vim, nano, notepad++ or any editor.

find extension=openssl remove ;

from ;extension=openssl to extension=openssl

save and restart server.

dipenparmar12
  • 3,042
  • 1
  • 29
  • 39
0
composer install

didn't fix the problem, but the following does:

composer update
Draken
  • 3,134
  • 13
  • 34
  • 54
thens
  • 41
  • 7
0

This problem can also arise if incorrect php.ini file is loaded. Make sure in your config php_module is defined in the httpd.conf

<IfModule php_module>
    PHPINIDir "C:/xampp/php"
</IfModule>
Aryan
  • 144
  • 1
  • 7
0

Hi! I had this same issue, I got these dlls and YAY openssl.dll is working again:

C:\php> .\deplister.exe .\ext\php_openssl.dll
php8.dll,OK
libcrypto-1_1-x64.dll,OK
libssl-1_1-x64.dll,OK
CRYPT32.dll,OK
KERNEL32.dll,OK
WS2_32.dll,OK
VCRUNTIME140.dll,OK
api-ms-win-crt-time-l1-1-0.dll,OK api-ms-win-crt-heap-l1-1-0.dll,OK
api-ms-win-crt-runtime-l1-1-0.dll,OK
api-ms-win-crt-stdio-l1-1-0.dll,OK
api-ms-win-crt-convert-l1-1-0.dll,OK
api-ms-win-crt-environment-l1-1-0.dll,OK
api-ms-win-crt-string-l1-1-0.dll,OK api-ms-win-crt-math-l1-1-0.dll,OK\