2

I get the following error:

Call to undefined function openssl_encrypt() in Encrypter.php line 73

It may seem obvious, but OpenSSL extension is enabled in my config, this error occurs only when using artisan serve, looked through config and it is enabled.

Did some research: Copied the following code in the artisan file

$loaded = extension_loaded('openssl');
var_dump($loaded);die();

And it returned true. But when I copy the same code into /public/index.php it returns false.

So I assumed that the openssl extension is enabled in php-cli, but for some reason it gets disabled after reaching the bootstrap file.

*And I am using UniServer if someone is interested.

jww
  • 97,681
  • 90
  • 411
  • 885
gegham-ayvazyan
  • 41
  • 2
  • 12

1 Answers1

6

Had same issue on Apache 2.4, PHP7, Fresh Laravel 5.3 on a Windows. My Apache error log showed

"PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\wamp\\php\\ext\\php_openssl.dll' - The operating system cannot run %1.\r\n in Unknown on line 0"

Fixed it by copying libeay32.dll and ssleay32.dll from PHP-root folder to Apache/bin folder and restarted Apache.

Titken
  • 81
  • 4
  • 1
    "copying libeay32.dll and ssleay32.dll from PHP-root folder to Apache/bin folder and restarted Apache" solved my problem. – endo64 Sep 08 '17 at 07:32