Composer Warning: openssl extension is missing. How to enable in Denwer - php

I try install Composer and it returns error: The openssl extension is missing. The recommended option is to enable the extension in your php.ini.
In php.ini string "extension=php_openssl.dll" is not commented out.
I use Denwer.
How can I solve my problem?

According with this Question: Composer Warning: openssl extension is missing. How to enable in WAMP WAMP (like Denwer) uses different php.ini for Apache and for CLI (PHP running in terminal, like composer).
As long I can see the php.ini file in Denwer is locate in "C:\WebServers\usr\local\php5\php.ini" and by default line "extension=php_openssl.dll" is commented (;), even uncommenting it PHP doesn't load OpenSSL.
In this site: http://hardmandev.com/article/nastroyka-openssl-dlya-denwer/ (In Russian) they suggest a way to make Openssl works on Denwer. According the feedback in the commentaries, this trick works.
I hope this can help you.

Related

OpenSSL support disabled in Apache/PHP on Windows

openssl is disabled apache2.4 with php7.1
in phpinfo(); results give me this
OpenSSL support disabled (install ext/openssl)
i changed this in php.ini
extension=php_openssl.dll
i use this code using WINDOWS CMD
set OPENSSL_CONF=/path/to/openssl.cnf
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
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"
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 :)
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.
I have added new php version 8.2.1 today
uncommented extension_dir = "ext"
uncommented extension=openssl
Wamp control manager shows that openssl is enabled
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

The mbstring extension is missing?

I know there's tons of topics about my problem, but I can't find a solution.
I'm using wamp and I've changed my version of PHP from 5.5.12 to 5.6.16, then when I go to localhost/phpmyadmin i have this error displayed :
Fatal error: Call to undefined function mb_detect_encoding() in
C:\wamp\apps\phpmyadmin4.1.14\libraries\php-gettext\gettext.inc on
line 177
So I update phpMyAdmin from 4.1.14 to 4.5.2.
And I have this **** error:
phpMyAdmin - Error The mbstring extension is missing. Please check
your PHP configuration.
My php.ini, phpForApache.ini is configured, I have un-commented the extension, set extension_dir to C:\wamp\bin\php\php5.6.16\ext, I stumbled on many topics/forum but none of the solution works.
Do you have any idea?
Please check #36254548
Copying the php.ini file to "wamp64\bin\apache\apache2.4.17\bin" has solved my problem.
Sometimes the extensions directory is well pointed to, the dll files have been uncommented but it still doesn't work.
The next solution to use, that is if your extensions directory is correct and dll files for the mbstring has been uncommented, then copy the php.ini file and paste it into the windows directory (i.e. C:\Windows).
You then restart your wamp/xampp and it will work.
check your php.ini file. In the extensions part of the configuration you should find:
;extension=php_mbstring.dll
remove the leading ';' to uncomment and enable the extension so it looks like this:
extension=php_mbstring.dll
restart your apache and it should work.
I faced the same issue when I start wamp, suddenly my project was not working and when I check the phpmyadmin, it gives the same above error.
My debugging process found php.ini file is missing. However I already installed two PHP versions, 5.6.19 and 7.0.4. I changed the version to 7.0.4 and then re-changed to 5.6.19. It started work.
What I guess, while changing the version, all the configuration files getting re-installed in wamp folder.

Installing Composer OpenSSL Issue

I am trying to install composer however when I go to install it I get this error:
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The openssl extension is missing, which means that secure HTTPS transfers are impossible.
If possible you should enable it or recompile php with --with-openssl
I currently have php 5.4.31 and I am running WAMP2.2 I've checked my php.ini file in the bin/php/php5.4.31/ and ensured that the following line is uncommented:
extension=php_openssl.dll
The error still resolves and I'm at a loss as to how I can fix it. As I thought by uncommenting the line it would be enabled.
Also when I run this command in the terminal window php --ini I get the following message:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\php_openssl.dll' - The specified module could not be found
If you are a windows user, make sure to uncomment this line in your php.ini file:
extension_dir = "ext"
It makes sure that PHP is taking the extension from its own ext library.
#Javacadabra, extensions like php_openssl.dll will be under php/ext/ directory, you could fix this path in the config file or you could copy that specific file from php/ext directory to php directory.
in your case it will be c:\php\ext

Openssl needs to be enabled (ZF2 installation)

First of all I realize this may be a possible duplicate, but I've looked at the other thread and that does not resolve my issue.
Basically I'm trying to install Zend Framework 2 and am trying the following command on a WAMP stack setup:
php composer.phar install
I get an error (You must enable the openssl extension to download files via https) which I have tried the following for:
From the WAMP UI, changed the php.ini line 'extension=php_openssl.dll'
From the WAMP UI, confirmed that php_openssl has a tick next to it
Changed both php.ini files in wamp\bin\php\php.5.4.12 (one is called development and the other production) with the line 'extension=php_openssl.dll'
Still, it produces the same error.
Just add extension=php_openssl.dll to wamp\bin\php\php5.4.12\php.ini
As #Adrian mentioned, just add the line to php.ini in the specified directory. Or a better approach would be to find this line of code
;extension=php_openssl.dll
and just remove the semi-colon before it. I have this code in line 970 in my wamp\bin\php\php5.4.16\php.ini file. It should somewhere around there if you're using the latest version of WAMP. Or just press CTRL+F and search of this bit of code. Hope this helps.

Fatal error: Call to undefined function openssl_random_pseudo_bytes()

I am getting this exception when trying to run my PHP unit tests:
Fatal error: Call to undefined function openssl_random_pseudo_bytes()
What does it mean?
I had the same issue. I solved it by editing my php.ini file - changing ;extension=php_openssl.dll to extension=php_openssl.dll .
(For my installation, my php.ini file was located in my P:\Program Files\EasyPHP-12.1\conf_files\ directory.)
Your version of PHP wasn't compiled with the openssl module. If you are building from source, add the module like so:
cd /path/to/php-5.4/
./configure --with-openssl
It means you do not have the openssl extension enabled in your PHP install. It needs to be enabled for you to use openssl_* functions.
It means you possibly don't have openssl enabled.
If you are on windows its even easier to load it. Enable it from wamp icon on system tray.
Check your configuration php.ini:
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
;extension_dir = "./"
; On windows:
extension_dir = "ext"
extension=php_openssl.dll
Your php installation either does not have openssl enabled, or you could be running a version of php < 5.3.
To enable openssl, you must re-compile and install php with the "–with-openssl" flag. See php installation documentation
For me this error occurred because i had not configured openssl correctly for my PHP.
This is the exact step i followed to rectify this error.
https://stackoverflow.com/a/36070260/1221096

Categories