7

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
  • 97,681
  • 90
  • 411
  • 885
Maher Bek
  • 271
  • 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

4 Answers4

19

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
  • 271
  • 1
  • 2
  • 5
2

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
  • 101
  • 4
  • 13
  • Thanks however it still says PHP Warning: PHP Startup: Unable to load dynamic library 'openssl'. I basically copied php.ini in cli folder to the /usr/local/lib . What do I need to do? – Hesam Moosapour May 01 '23 at 10:12
1

I have added new php version 8.2.1 today

  1. uncommented extension_dir = "ext"
  2. uncommented extension=openssl
  3. Wamp control manager shows that openssl is enabled enter image description here

4. Exit wamp and also restarted All services

Still the Problem persisted on phpinfo() and phpmyadmin

The solution worked for me after all is to Restart my laptop

Solomon Tesfaye
  • 186
  • 2
  • 10
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,999
  • 3
  • 32
  • 50