You must enable the openssl extension to download files via https - php

I wanted to install Zend Framework 2. So I downloaded the skeleton application. As mentioned in the ZF2 manual, we have to issue the command
php composer.phar install
Inside the skeleton.
But I'm getting an error
You must enable the openssl extension to download files via https
Then I enabled the ssl_module in my wamp, I checked the php_ini file and I can see the following line
extension=php_openssl.dll
Still I'm getting the same error. Anybody having any clue what I missed out?

PHP CLI SAPI is using different php.ini than CGI or Apache module.
Find line ;extension=php_openssl.dll in wamp/bin/php/php#.#.##/php.ini
and uncomment it by removing the semicolon (;) from the beginning of the line.

Verify you are editing the correct php.ini file.
Reference:
https://github.com/composer/composer/issues/1440
"WAMP uses different php.ini files in the CLI and for Apache. when you enable php_openssl through the WAMP UI, you enable it for Apache, not for the CLI.
You need to modify C:\wamp\bin\php\php-X.Y.Z\php.ini to enable it for the CLI."

make sure you have correct path to extension folder
extension_dir = "ext"
by default it is commented with ; character

I also had the same issue while playing around Zend Framework 2 and composer. I'm using PHP 5.4 (installed via macports) and my solution was to install openssl for PHP 5.4 via macports as well.
sudo port install php54-openssl

I have faced this problem, but configuging openssl (also for cli) did not help.
I have updated composer and this sloved my problem.
Just type:
$ php composer.phar self-update
or
$ composer selfupdate
Good luck!

I use XAMPP. In C:\xampp\php\php.ini, the entry for openssl did not exist, so I added "extension=php_openssl.dll" on line 989, and composer worked.

You need to enable "extension=php_openssl.dll" in both files (php and apache). my pc files path are these :
C:\wamp\bin\php\php5.3.13\php.ini
C:\wamp\bin\apache\apache2.2.22\bin\php.ini

Uttam, if your issue is not solved then try the follwoing 3 step approach. It worked for me as I had exactly same issue.
step1: click on wamp tray icon.
step2: goto menu apache->apache modules
step3: click on menu item "ssl_module"
it will automatically restart wamp. if wamp not restarted automatically then restart it through wamp tray menu-> Restart All services. After restart confirm that "ssl_module" coming as ticked under menu apache->apache modules
after that just attempt the php composer.phar install
from going through the response shared by you, php.ini file contains extension=php_openssl.dll and the php/ext directory also have file "php_openssl.dll"
good luck

The Valery's answer helped me:
https://stackoverflow.com/a/14265815/492457
WAMP uses different php.ini files in the CLI and for Apache. when you
enable php_openssl through the WAMP UI, you enable it for Apache, not
for the CLI. You need to modify C:\wamp\bin\php\php-5.4.3\php.ini to
enable it for the CLI.

Make sure that you update your php.ini for CLI. For my case this was C:\wamp\bin\php\php5.4.3\php.ini and uncomment extension=php_openssl.dll line.

Late answer but adding so other can learn the reason.
You also need to edit the php.ini file in the "wamp\bin\php\php-X.Y.Z" location.

I had to uncomment extension=openssl in php.ini file for everything to work!

Becareful if you are using wamp don't use the wamp ui to enable the extension=php_openssl.dll
just go to your php directory , for example : C:\wamp\bin\php\php5.4.12 and edit the php.ini and uncomment the extension=php_openssl.dll.
it should work.

Was facing this error
"You must enable the openssl extension in your php.ini to load
information from.."
I solved by finding and uncommenting the following lines on php.ini file
;extension=php_openssl
;extension_dir = "/c:\wamp64\bin\php\php 8.0.25\ext\/"
;extension=bz2
;extension=curl
;extension=fileinfo
;extension=gd
;extension=gettext
;extension=gmp
;extension=intl
;extension=imap
;extension=ldap
;extension=mbstring
;extension=exif
;extension=pdo_sqlite
;extension=shmop
in
Wamp/bin/php/php 8.0.25/php.ini
Uncomment both by removing the semicolon (;) from the beginning of each line.
If you have the latest PHP v^8 or above, likely you won't see php.ini file. So what you do is to make a copy of php.ini-development which you will see there and then rename the copy you just made to php.ini and then do the same uncommenting of the two lines then save.

Related

PHP Startup Unable to load dynamic library /usr/lib/php/20151012/php_mysqli.dll

I have ubuntu 14.04 EC2 instance. I have installed php 7 on it. when I execute any php command like php --version or any other. I get following error
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mysqli.dll' - /usr/lib/php/20151012/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0
I have tried following
enable php_mysqli.dll in php.ini
enable mysqli.so
enable php_mysqli.so
sudo apt-get install php-mysql
but nothing worked for me.
Any suggestion how I can solve this?
If you are on Linux, you shouldn't have DLL files but SO files.
So first, you have to remove / disable the php_mysqli.dll you added in php.ini.
In order to use mysqli, you should then :
install the package for Ubuntu : apt-get install php-mysql
check if it is already enabled (with phpinfo() for example)
if not enabled, enable the module - check in /etc/php/mods-available/ folder if there is a mysqli.ini, containing extension=mysqli.so, then check for CLI / FPM / Apache / other if there is the symbolic link pointing to this file (for example for CLI, in /etc/php/cli/conf.d/ : 20-mysqli.ini -> ../../mods-available/mysqli.ini)
restart php / apache / nginx depending what you are using
In my case, it happened because I uncommented the extension=php_mysqli.dll line in php.ini file for running some other package. After Googling around I found that you should not uncomment anything directly from php.ini instead you should install the required PHP extension and it will do the rest.
I have recently encountered this problem on ubuntu16.04, I finally resolve it by adding a semi-colon at each line like extension=php_*.dll,I think that is because LAMP on ubuntu is intelligent enough,it automatically opens all of the extensions for us. And on windows,we have to enable the extensions manually by remove the semi-colon at each line like ;extension=php_*.dll in php.ini.
Run Phpinfo()
Search for your php.ini path
search extension=php_mysqli.so
comment like this
;extension=php_mysqli.so
If you are on Linux and using php8.1,
try to commenting extension=pdo_mysql in directory /etc/php/8.1/cli/php.ini file if the extension is uncommenting
uncommenting extension=pdo_mysql in directory
/etc/php/8.1/apache2/php.ini file if the extension is commenting
this method work for me
I just had the same problem and realised they were two folders in my /etc/php/7.0, which were apache2 and cli. Turned out the extension line in cli/php.ini was uncommented with the dll file, not the one in apache2 directory. Commenting it just solved the problem.
I managed to solved it like this:
add libs to php.ini (etc/php/7.3/apache2; etc/php/7.3/cli folders)
extension=pdo_mysql.so
restart apache (sudo systemctl restart apache2)
comment libs in php.ini (etc/php/7.3/apache2; etc/php/7.3/cli folder)
extension=pdo_mysql.so
go etc/php/7.3/mod_available
comment extension (because it is already loaded), for example, etc/php/7.3/mod_available/pdo_mysql.ini
;extension=pdo_mysql.so
If you see mcrypt.so under /etc/php/7.2 or /etc/php/7.3 just delete it and restart the server it will resolve the issue.
As when we updrage the php to latest version that file may get stored to latest versions which is not required.
I used following commands:
cd /etc/php/7.3
sudo rm -rf mcrypt.so
sudo service apache2 restart
Just comment out all lines with .dll extensions because you are on Ubuntu. Ubuntu support .so files.
In php.ini under Dynamic Extensions the line extension=php_mysqli.dll was enabled.
I disabled it by adding a semi-colon at the head of the line ;extension=php_mysqli.dll.
Saved and exited php.ini. Restarted Apache.
This resolved the error for me.

php xsl extension missing magento readiness check

I'm trying to install magento on my Windows 10 system with MAMP PRO, and I have been getting the same error over and over for a while now. The magento installer says that my php xsl extension is missing. To install the extension, the manual says that I have to add the argument --with-xsl[=DIR] to my configure line but I have no idea how to do this.
I have added extension=php_xsl.dll to my php.ini file but it still isn't added. The php_xsl.dll is present in my /ext folder.
What could the issue be?
Uncomment the following line from php.ini file(remove ';' from the line)..
;extension=php_xsl.dll
in xamp/php/php.ini search and modify php.ini file, search ;extension=php_xsl.dll line, remove ; at the line start and save php.ini file. Then open xampp manager, stop Apache services and restart again.
This is because the XSL extension is not enabled.
To enable the XSL extension go to the location where the MAMP (or XAMPP) is installed. Then go to php/php.ini.
Un-comment the line extension=php_xsl.dll and restart the server.
Go to php.ini file
Change ;extension=xsl to extension=xsl
Restart your Apache xampp
First, stop apache.
Edit C:\xampp\php\php.ini
Only remove ; at the begiinning of the line extension=php_xsl.dll
Then start apache again
It will work proper.
You can solve this error simply by following these easy steps.
Stop the Apache server first
Then go to C:\xampp\php
Open php.ini file
Then uncomment all required extensions (;extension=xsl to extension=xsl)
Save it and exit
Then start xampp again and try to install
After what seemed like a million frustrating attempts, I finally came across this page and the note above. For some reason, the php.ini file in my MampPro php 7.0.9 was missing the intl and xsl dll (even though I kept uncommenting the ";"
Anyway - I saw the note above and was able to make the amends -- and voila, the issue was resolved.
I wish somehow this info was made available in php documentation and in MampPro site too. Hopefully, this won't be an issue in future patches or updates.
Go to your php root folder,
Copy all icu* * * *.dll files:
from C:\xampp\php
to C:\xampp\apache\bin
Are your other ext you've loaded in php.ini working nomarlly ?.(Try php_info())
And did you think u've download correctly .dll file.
I was installing Magento 2.1 on MAMP PRO WINDOWS (something that is not supported and not done) as a total newbie.
The same problem popped up intl en xsl extensions missing while ; was removed.
After trying everything I just looked at the php.ini location phpinfo()
C:\Users\Public\Documents\Appsolute\MAMPPRO\conf\php7.0.6.ini
Copied the php7.0.6.ini I changed on several locations an many times just into this windows directory and all my troubles were gone.
Magento is often installed on Linux. The title of this question above doesn't specify the server but the question does so I stumbled on this answer though I was looking for the Linux solution. So if anyone is looking for how to enable the xsl extension on Ubuntu, the answer is here: Enable XSL on Ubuntu 12.04
Search for php.ini in php fold and remove ; from ;extension=php_xsl.dll and you are good to go
The most upvoted answers are not telling you where to go to edit these files.
The correct path is: C:\MAMPPRO\conf\php(version number here)
Then you can remove the ; from the line extension=php_xsl.dll and restart the server.
In Installer.php line 545 error in magento 2.4.1
uncomment the following in your php.ini file by removing ";" for
;extension=intl
;extension=soap
;extension=xsl
;extension=sockets

PHPMYADMIN: mbstring extension is missing [duplicate]

Whenever I try to enter my phpMyAdmin, it gives me this error:
The mbstring extension is missing. Please check your PHP configuration.
I've looked all over the Internet for a fix, but all I've found is errors similar to mine, but not the same, or the exact same but there was no fix given.
I am also using Windows.
In Centos I have installed a php extension.
I did this with:
yum install php-mbstring
Before sometime I also had the same problem. I have tried replacing the .dll file but no result. After some debugging I found the solution.
I had this in my php.ini file:
extension_dir = "ext"
And I'm getting mbstring extension missing error. So I tried putting the full path for the extension directory and it works for me. like:
extension_dir = "C:\php\ext"
Hope this will help.
Cheers,
check your php.ini file in the root directory of your php installation. 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.
Edit: I just read that you are already using a webhost. Does your webhost have a interface where you can set php variables etc? Or a .ini file you can edit?
If not you may are forced to talk to the webhost and ask them to enable that particular extension.
My case was like this
Strangely, I noticed that the php.ini file that WAMP was using wasn't
the one in the php directory, but rather was referencing a php.ini
file in the bin directory... I copied my php.ini file to
wamp\bin\apache\apache2.4.17\bin directory, restarted the wamp
services and PHPMyadmin was off and running...
Thanks I solved the problem
In Ubuntu Server I have installed a php extension.
I did this with:
sudo apt-get install php-mbstring
Another reason for this problem is Php version. When I changed the running PHP version to 7.0.0, problem has gone.
Ubuntu 15.10
1) sudo nano /etc/php/7.0/apache2/php.ini
uncommited extension=php_mbstring.dll
2) sudo apt-get install php7.0-mbstring
3) restart apache2
install mbstring and restart your apache:
sudo apt-get install php-mbstring
sudo service apache restart
then remove ; from your php.ini file:
;extension=php_mbstring.dll
to
extension=php_mbstring.dll
If it still doesn't work..remove your php setup, without removing the databases from your phpmyadmin. Reinstall it.
NB: * if you want to remove all, all mention the one you need to.
sudo apt-get remove php*
Then install the php and modules of the php version that you need. here, php 7.1:
sudo apt-get install php7.1 php7.1-cli php7.1-common libapache2-mod-php7.1 php7.1-mysql php7.1-fpm php7.1-curl php7.1-gd php7.1-bz2 php7.1-mcrypt php7.1-json php7.1-tidy php7.1-mbstring php-redis php-memcached
restart your apache and check the php version.
sudo service apache restart
php -v
when all this is done, execute the following command to enable mbstring forcefully and restart your apache.
sudo phpenmod mbstring
sudo service apache restart
Hope it helps.
It did to me :)
I've solved my problem by this way:
Edit the php.ini file:
change extension_dir = "ext" into extension_dir = "D:\php\ext" (please write ur own full path for the extension directory)
change ;extension=php_mbstring.dll into extension=php_mbstring.dll (delete the ";")
Then just save your php.ini file and copy it to ur Windows directory。(“C:\Windows“)
restart the apache server。
The above is my solution,Hope it will work for u.
Using xampp, this will work (php7 has been extracted to the xampp\php directory):
Make the following changes in the php.ini:
uncommend (remove the ;)
;extension=php_mbstring.dll
uncommend (remove the ;)
;extension=php_mysqli.dll
set the path to the extention Directory
extension_dir = "ext"
to the full path, for example:
extension_dir = "C:\xammp\php\ext"
Additional, change the xampp-settings in the httpd-xampp.conf:
change
LoadFile "C:/xampp/php/php5ts.dll"
to
LoadFile "C:/xampp/php/php7ts.dll"
change
LoadModule php5_module "C:/xampp/php/php5apache2_4.dll"
to
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
change all appearance (3 times) of
IfModule php5_module
to
IfModule php7_module
That's it.
I had this problem in the past with MAMP on a Windows machine.
Open MAMP start page and go to your current configuration of PHP (phpinfo).
Check the Configuration File (php.ini) PATH.
Mine was set to C:\Windows, where of course I had no PHP.ini file.
Either change the php.ini path to C:\MAMP\conf\php5.6.8 (or your php version conf path) or just copy php.ini to c:\windows.
after installing WAMP 3 with Apache 2.4.17 and php5.6.17 I tried to look at php.ini from wampserver (green icon in tray).
It wasn't finding it.
I copied php.ini from the php.5.6.15 directory to the apache2.4.17\bin\ directory
and phpmyadmin worked fine without missing mbstring
Solved it.
I tried all of the solutions above but it still did not work. I'm currently using WAMP to launch the mysql server. When I tried to open the "php.ini" file with the WAMP panel, it said that it did not exist and asked me to create a new "php.ini" in the location, "C:\wamp\bin\apache\apache2.4.17\bin". Once I created this new "php.ini" file, I located the existing "php.ini" file which was in the path "C:\wamp\bin\php\php5.6.15", and cloned it. I then pasted the clone in the previous path where it had asked me to create the "php.ini" file.
Hope this helped.
I just installed WAMP 3 on Windows 10 and had this issue.
I had to go to C:\wamp64\bin\php\php7.0.0\ and copy the php.ini file to C:\wamp64\bin\apache\apache2.4.17\bin\
Then I restarted WAMP, and was finally able to access my phpMyAdmin file.
Note: this is probably not the correct way to do this because now there are 2 php.ini files. There is probably a setting in an Apache file that points to the php.ini file, but I haven't seen that yet. I will update this if I find it.
Strangely, I noticed that the php.ini file that WAMP was using wasn't the one in the php directory, but rather was referencing a php.ini file in the bin directory... I copied my php.ini file to wamp\bin\apache\apache2.4.17\bin directory, restarted the wamp services and PHPMyadmin was off and running...
In newer versions of PHP, "extension_dir" is not initially enabled.
In php's directory try change extension of configuration file (php.ini-development - default value of this file). I changed it to php.ini and phpmyadmin has worked.
The program can't start because php_mbstring.dll is missing from your computer. Try to fix it.
i use appserver to localhost and my server: C:/AppServ/www/dvd2/variables.php
Mozilla/5.0 (Windows NT 6.1; rv:33.0) Gecko/20100101 Firefox/33.0
Apache/2.2.8 (Win32) PHP/5.2.6
To solve this problem on Linux, you need to recompile your PHP with the --enable-mbstring flag.
You might get this error message if you've just installed the phpmyadmin package but haven't restarted apache yet; try restarting apache.
Please uncomment the following lines at php.ini
;extension=php_mbstring.dll
;extension=php_exif.dll ; Must be after mbstring as it depends on it
;extension=php_mysql.dll
;extension=php_mysqli.dll
This will help to solve.
The version of phpadmin you have installed is not compatible with the version of apache. Install the compatible version and you should be fine
I recently updated from PHP 5.4.44 to PHP 5.6.12 on my Windows 8.1 OS and got this phpMyAdmin missing mbstring error message.
After trying the above suggestions, none of which worked for me, I discovered version 5.4.44 placed the DLL extensions in the PHP root directory whereas version 5.6.12 placed them in the PHP\ext subdirectory.
All very fine except unfortunately someone forgot to change the php.ini accordingly. So two possible solutions:
Copy the DLL extensions from the ext sub-directory into the PHP root directory, or
Edit the php.ini file to call all the DLL extensions from the ext sub-directory.
I chose the easier first and phpMyAdmin now works fine.
Depending on you OS, you might need to install additional packets, e.g. php5-mbstring in SLES Linux.
I check phpinfo() and look for this line:
Configuration File (php.ini) Path C:\Windows
And I copy php.ini from C:\xampp\php to the folder and it works for me.
I had the same problem, the above solutions are not worked for me.
What I did is uninstalled the wamp and logout the Skype and re-installed wamp.
Then It got worked. I think the port used by wamp and Skype is same.
Hope this input will help.
Cheers :)
my solution : Copy a shortcut from your php.ini from your php-directory to the apache-dir. This way you refere too 1 file on the correct place. This solved (at least in my case) the problem.
just copy the php.ini file from C:\wamp\bin\apache\apache2.4.17\bin to C:\wamp\bin\apache\apache2.4.17\bin and then again restart apache server..
it will work fine.
My solution:
I had wamp x32 installed before, needed to remove and then installed the x64, receiving the same message "The mbstring extension is missing. Please check your PHP configuration.".
On php.ini, all references to wamp, such as extension_dir = were pointing to "C:/Program Files/Wamp/...". Check all paths, the correct for me is "C:/Wamp64/". Restart services and it's all right now.
The installation process adds the phpMyAdmin Apache configuration file into the /etc/apache2/conf-enabled/ directory, where it is read automatically. The only thing you need to do is explicitly enable the mbstring PHP extension, Because sometimes you forgot to enable the mbstring mode so simply type the below command to enabled the mbstring mode...
sudo phpenmod mbstring
Afterward, restart Apache for your changes to be recognized:
sudo systemctl restart apache2

How to enable PHP's openssl extension to install Composer?

I am trying to install Laravel in WAMP setup. I am getting a warning message for not enabling openssl which I had already done in WAMP.
Here is a screenshot of the message.
It is possible that WAMP and Composer are using different PHP installations. Composer will use the PHP set in the PATH environment variable.
If you want to enable the openssl extension to install Composer, first you need to check the location of the PHP installation.
Open a Command Prompt, type: echo %PATH% then check for the location of your PHP installation.
Go to that location and edit the file named: php.ini.
Uncomment the line extension=php_openssl.dll by removing the semicolon at the beginning.
Now you are good to install Composer.
I solved my problem a different way. The problem is that wamp's GUI was misleading: it claimed that I had php_openssl enabled.. and if I clicked on php.ini on the same GUI.. it actually showed that extension=php_openssl.dll was uncommented..
I'm not sure if i'm using the same installer version of composer of the OP, but it actually asks you at the beginning to specify the php.exe that you like to apply composer on (which basically ensures that no one tries to apply composer to the wrong php executable as what happened with the OP)..
The way I solved this was by going myself into the installation of php within the wamp package: C:\wamp\bin\php\php5.4.12 and looking php.in there.. when I opened it I was shocked that the line extension=php_openssl.dll was actually commented! I uncommented it and it worked just fine.
I had the same problem and here the solution I found, on your php.ini you need to do some changes:
extension_dir = "ext"
extension = php_openssl.dll
Every one here talks active the openssl extension, but in windows you need to active the extension dir too.
For WAMP server, comment given by "Enrique" solved my problem.
wamp is using this php.ini:
c:\wamp\bin\apache\Apache2.4.4\bin\php.ini
But composer is using PHP from CLI, and hence it's reading this file:
c:\wamp\bin\php\php5.4.12\php.ini (so you need to enable openssl there)
For composer you will have to enable extension in
c:\wamp\bin\php\php5.4.12\php.ini
Change:
;extension=php_openssl.dll
to
extension=php_openssl.dll
If you're doing this on Windows without one of the WAMP stacks, here's how to get this going
Download an installation of PHP for Windows. Generally you'll want a non-thread safe install. You can use 32-bit or 64-bit builds
Extract the zip file somewhere. I would suggest C:\php. Composer's installer found it there without any additional prompting
The latest versions of PHP for Windows do not come with a php.ini by default. Instead, you'll see two files, as noted below. Rename one to php.ini or copy it into php.ini.
php.ini-development
php.ini-production
Open your php.ini file and remove the semicolon from this line (you might want to uncomment other things as well but this line is the only one necessary for Composer)
;extension=php_openssl.dll
That should be all you need to do. The Composer installer should do everything else you need from here.
You need to enable "extension=php_openssl.dll" in both files (php and apache). my pc files path are these :
C:\wamp\bin\php\php5.3.13\php.ini
C:\wamp\bin\apache\apache2.2.22\bin\php.ini
This is an old question but I just had the same issue (with PHP7) and the solution was, in the end, pretty simple. Uncommenting the line in php.ini as per the other answers wasn't quite enough though. I needed to change it from:
;extension=php_openssl.dll
to:
extension=ext/php_openssl.dll
Note the ext prefix. The dll already existed but was in a subfolder. After changing the config the composer installer was happy.
you need to enable the openssl extension in
C:\wamp\bin\php\php5.4.12\php.ini
that is the php configuration file that has it type has "configuration settings" with a driver-notepad like icon.
open it either with notepad or any editor,
search for openssl "your ctrl + F " would do.
there is a semi-colon before the openssl extension
;extension=php_openssl.dll
remove the semi-colon and you'll have
extension=php_openssl.dll
save the file and restart your WAMP server after that you're good to go.
re-install the application again that should work.
There are two php.ini files, one for development and one for production. Leave those, there is another php.ini file for configuration settings just above them with a gear like icon edit that.
After editting the "right" files (all php.ini's). i had still the issue.
My solution was:
Adding a System variable: OPENSSL_CONF
the value of OPENSSL_CONF should be the openssl.cnf file of your current php version.
for me it was:
C:\wamp\bin\php\php5.6.12\extras\ssl\openssl.cnf
-> Restart WAMP
-> should work now
Source: http://php.net/manual/en/openssl.installation.php
I faced the same problem, but when i was lokking for php.ini and php.exe i found php.exe at C:\UwAmp\bin\php\php-5.4.15 when php.ini at C:\UwAmp\bin\apache.
I just copy php.ini at C:\UwAmp\bin\php\php-5.4.15 and Uncomment the line extension=php_openssl.dll and it fixed.
I am using WAMP server.
Actually its files showed that openssl is opened.
But manually I went to the folder and edited php.ini.
Then I found it has not opened openssl.I uncommented it and it worked after after WAMP restart.
C:\wamp\bin\php\php5.3.13
Browse to the line that reads:
;extension=php_openssl.dll
and remove the semicolon preceding the line. Restart your WAMP server services (click in your icon tray > 'Restart All Services'
If you still cannot solve your problem have a look at this. This might be the solution you are looking for
There are several php.ini files in C:\wamp\bin\php\php x-y-z folder. You may find production, development and some other php.ini files. No point of editing production and development files. Find the file which is exactly as same as the below image. (You can find it. Just type php.ini in your search bar and do a search). Open the file and remove ; from extension=php_openssl.dll. Save the file and close it. Restart all services in Wampp server. Re-install your composer.
That is it.
Wamp works with another php.ini that is in C:\wamp\bin\apache\Apache2.4.4\bin\php.ini. So you need to manualy find the correct file, that is in C:\wamp\bin\php\php5.4.12\php.ini. Uncomment the extension=php_openssl.dll line and just try to install Composer again.
For those who're having the same problem as I was. After doing all the solutions above, still didn't work for me. I found out that, uWamp was creating the PHP.INI file in bin/apache directory. So I had to copy the PHP.INI file into php installation directory, that is, bin/php/phpXXXX directory. This should also be where the php.exe is that you selected from the composer setup.
Hope this helps.
If you compiled from source, then adding extension=php_openssl.dll to the php.ini file may not work.
To troubleshoot this, open a command prompt and type php -i. Scroll up to the first line, it will tell you the most recent error regarding your php.ini file.
To solve the issue, find the php_openssl.dll file, for me it was in the very same directory of the compilation output:
C:\php-sdk\bin\phpdev\vc14\x64\php-7.0.13-src\x64\Release_TS
So just add the directory where the extension is, to the php.ini:
extension_dir = "C:\php-sdk\bin\phpdev\vc14\x64\php-7.0.13-src\x64\Release_TS"
Hopefully the error will be gone
If you are using xampp .Go back to where you choose which command-line php you want to use at the beginning of your installation and select the path where your xampp folder is included.After that if your installer says youve got duplicate 'extension=php_openssl.dll' comment one ssl file in your php ini with a ';'and your installation should run smoothly.

Composer Warning: openssl extension is missing. How to enable in WAMP

Trying to install Composer dependency management tool on Win7/64 + WampServer 2.2 via the Setup Installer and I am getting the following message:
The openssl extension is missing, which will reduce the security and stability of Composer.
If possible you should enable it or recompile php with --with-openssl
So here is what I did...
From my Wamp icon in Tray, clicked php > php extensions > php_openssl
This showed that task was completed by placing a check mark beside the extension
I then restarted WampServer
Then from the Wamp icon in tray, I clicked php > php.ini and searched for openssl to verifiy it was NOT commented) out. It was not.
I then went back to Composer-Setup.exe and tried again. Same Warning Message: "openssl extension is missing"
Having never worked with OpenSSL, I'm not sure what is supposed to be set, so I tried to browse to one of my local sites using https. It Failed.
What am I missing?
Please advise.
WAMP uses different php.ini files in the CLI and for Apache. when you enable php_openssl through the WAMP UI, you enable it for Apache, not for the CLI.
You need to modify C:\wamp\bin\php\php-5.4.3\php.ini to enable it for the CLI.
In addition to uncommenting the ;extension=php_openssl.dll line in php.ini that everyone else has mentioned, you also have to ensure the ;extension_dir = "ext" line is also uncommented. To uncomment, remove the prefixed semicolon and save.
That line might already be uncommented in packages like WAMP and XAMPP, but it's not in a plain PHP download for Windows, so it's worth verifying. Also, you have to create the php.ini file by copying one of the examples, like php.ini-development to a new file and then name it php.ini. Then make these changes there.
Also, in the future, to install tools such as PHP and Composer, I recommend using the Chocolatey package manager. Then it's as simple as choco install composer. Of course, you'd still need to edit php.ini before installing Composer with the choco method. In future versions of Windows, package management tools like Chocolatey will be baked into Windows, the same way apt-get is in Ubuntu. Exciting times ahead for developers!
With either method, after installing Composer, don't forget to restart your terminal. Whether you're using Command Prompt, Bash (installs with Git), or Powershell, you'll need to restart it before the updated environmental variables work.
I had the same problem even though openssl was enabled. The issue was that the Composer installer was looking at this config file:
C:\wamp\bin\php\php5.4.3\php.ini
But the config file that's loaded is actually here:
C:\wamp\bin\apache\apache2.2.22\bin\php.ini
So I just had to uncomment it in the first php.ini file and that did the trick. This is how WAMP was installed on my machine by default. I didn't go changing anything, so this will probably happen to others as well. This is basically the same as Augie Gardner's answer above, but I just wanted to point out that you might have two php.ini files.
uncomment ;extension=php_openssl.dll in both
wamp\bin\php\php5.4.12\php.ini
wamp\bin\apache\Apache2.4.4\bin\php.ini
it will work
C:\laravel-master>composer create-project laravel/laravel
Installing laravel/laravel (v4.0.6)
- Installing laravel/laravel (v4.0.6)
[RuntimeException]
You must enable the openssl extension to download files via https
I'm using EasyPhp (WAMP type). In the EasyPHP Icon in the taskbar, right click and select configuration then select PHP. I will open the PHP.ini file configuration in a Notepad, search-find or CTRL+F in notepad for the word OPENSSL you will find this ;extension=php_openssl.dll just remove the ; and the extension=php_openssl.dll is active.
C:\laravel-master>composer create-project laravel/laravel
Installing laravel/laravel (v4.0.6)
- Installing laravel/laravel (v4.0.6)
Downloading: 100%
Created project in C:\laravel-master\laravel
Loading composer repositories with package information
Installing dependencies (including require-dev)
you need to edit the "c:\Program Files\wamp\bin\php\php5.3.13\php.ini" file
search for:
;extension=php_openssl.dll
remove the semicolon at the beginning
note: if saving the file doesn't work then you need to edit it as administrator. (on win7) go to start menu, search for notepad, right-click on notepad, click "Run As Administrator"
in the composer installation windows just click back then next (or close it and start again) and it should work
opened wamp/bin/apache/apache2.4.4/bin/php config..
wamp/bin/php/php5.4.16/php conf settings, php-ini production, php-ini dev, phpForApache find extension=php_openssl.dll and uncomment by removing ;
Short and sweet, uncomment this line in wamp/bin/php/php5.3.13(or whatever php version):
;extension=php_openssl.dll (remove the ;)
Now run the command line installation of Composer. You won't have an error.
Good to go!
You should make a symlink to php.ini. Sorry for russian link.
Yes, you must have to open php.ini and remove the semicolon to:
;extension=php_openssl.dll
remove the ";" like this and it will work.
extension=php_openssl.dll
Happy Coding.
For installing Composer below steps worked me:(WAMP version 2.4 x64bit)
edit ->
**C:\wamp\bin\php\php5.4.12\php.ini**
;;uncomment below line or remove the semicolons ';'
extension=php_openssl.dll
**C:\wamp\bin\apache\Apache2.4.4\bin\php.ini**
extension=php_openssl.dll
All those answers are good, but in fact, if you want to understand, the extension directory need to be right if you want all you uncommented extensions to work. Can write a physical or relative path like
extension_dir = "C:/myStack/php/ext"
or
extension_dir = "../../php/ext"
It's relative to the httpd.exe Apache web server (C:\myStack\apache\bin)
But if you want it to work with Composer or anything you need the physical path because the cli mode doesn't use the web server !
I was facing the same issue. I renamed my php folder from php7_winxxxx to just php and it worked fine. It looked like composer was checking the location to the php_openssl module in c:/php/ext.
You may also need to add c:/php to the PATH in environment variable

Categories