5

openssl is disabled apache2.4 with php7.1

in phpinfo(); results give me this

OpenSSL support disabled (install ext/openssl)

  1. i changed this in php.ini

extension=php_openssl.dll

  1. i use this code using WINDOWS CMD

set OPENSSL_CONF=/path/to/openssl.cnf

  1. its enabled when use in CMD this but its disabled in phpinfo();

php --ri openssl OpenSSL support => enabled OpenSSL Library Version => OpenSSL 1.0.2j 26 Sep 2016 Openssl default config => C:/jampp/php71/extras/ssl/openssl.cnf

its now working in CMD and but phpinfo(); not and in laravel 5 show me this error

Call to undefined function openssl_encrypt()

Thanks

jww
  • 90,984
  • 81
  • 374
  • 818
Maher Bek
  • 231
  • 1
  • 2
  • 5
  • Are you using wamp? – user1669496 Jan 17 '17 at 22:14
  • no i installed apache 2.4 and php 7.1 manually – Maher Bek Jan 17 '17 at 22:18
  • It would help if you cited some references for instructions you followed. Also see [openssl apache php windows enable site:stackoverflow.com](http://www.google.com/search?q=openssl+apache+php+windows+enable+site%3Astackoverflow.com). There are literally pages of results. – jww Jan 17 '17 at 23:22
  • @jww i opened all the links i googled it too but i didn't find the solution – Maher Bek Jan 18 '17 at 00:11
  • @MaherBek - Perhaps you should follow some of the instructions rather than opening the link and viewing the page. Some of the answers are quite extensive. – jww Jan 18 '17 at 00:16

3 Answers3

17

Thank you all its just need includes the (DLLs files of php) into httpd.conf

LoadFile "C:/jampp/php/libeay32.dll"
LoadFile "C:/jampp/php/ssleay32.dll"
LoadFile "C:/jampp/php/php7ts.dll"
LoadFile "C:/jampp/php/libpq.dll"
Maher Bek
  • 231
  • 1
  • 2
  • 5
0

Updated Answer 2021:

OpenSSL is in version 1.1 now. The LoadFiles file in another answer on this page have been replaced by 'libcrypto-1_1.dll' and 'libssl-1_1.dll'.

Honestly, though, that entire answer is probably outdated. In my case, the solution was far simpler. Everything I found on the internet says all you have to do is uncomment the line 'extension=openssl' in your php.ini file. However, there is usually a small piece of information omitted. You ALSO need to uncomment the line 'extension_dir = "ext"' on Windows or 'extension_dir = "./" on Linux. If you don't do this, then no extensions can load.

JamesHoux
  • 2,503
  • 3
  • 24
  • 46
0

Another possible solution for anyone struggling to enable OpenSSL on Windows. Run php --ini to check whether your ini file is being ran. In my case the configuration file was set to none.

My php installation came with development and production ini files, but I needed to create a new ini file called php.ini and include my settings there.

If anyone else is struggling to install composer, this fix may work for you :)

robert theboss
  • 81
  • 1
  • 10