I'm trying to install Composer on Windows 7 and XAMPP, but getting those errors/messages when run installation setup.
The PHP exe file you specified did not run correctly:
C:\xampp\php\php.exe
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
A duplicate setting in your php.ini could be causing the problem.
Program Output: Warning: Module 'openssl' already loaded in Unknown on
line 0
I have been googled for while, but could not find proper solution or anything related to this. Closest thing was to remove comment openssl extension in php.ini file, but did not worked for me. To be clear I have very basic understanding of server tweaking.
I guess this is a problem which had been asked here you can follow the solution or go to the below link whichever if you want.
I figured it out and successfully installed Composer in My windows 10 PC.
There are some steps you have to follow in order to solve your problem.
1st solution.
Find and Open php.ini located in your "php" folder In my case it is in xampp the file is in c:\xampp\php\
Find "extension=php_openssl.dll"
";extension=php_openssl.dll" uncomment by removing the semicolon ";"
Restart your xampp , now extension should be loaded after that.
Try again now you are able to install composer.
2nd solution(If the above solution not work for you then go with below solution . )
This works in my case
Find and Open php.ini located in your "php" folder In my case it is in xampp the file is in c:\xampp\php\
Open SHELL from Xampp start panel by clicking on shell button.
Write php in shell and hit enter
If you get some waring message in your shell something like below .
Then you have to fix these waring message by commenting all these extension in your php.ini file.(Actually cause of these warning messages are because more than one times that extension are enabled or you can say un-commented in php.ini file).
For Example which is in my case.
a). You can see in above image there is warning message for curl.
Module 'curl' already loaded in Unknown on line 0 .
b) To fix this find php_curl.dll file in your php.ini file and comment that extension by adding semicolon ";" in front of that extension like this ;extension=php_curl.dll
Follow above steps if you have more than one warning for each extension untill you are not getting any warning message in your shell.
Restart your xampp , now extension should be loaded after that.
Try again now you are able to install composer.
OpenSSL is being loaded twice. Look in your php.ini above to see
openssl.dll, and comment it out in one of the places.
– Farkie
Go to your xampp\php\php.ini
Press ctrl+f to find extension_dir and change its relative path to
absolute path e.g from extension_dir="\ext" to
extension_dir="E:\xampp\php\ext"
Press ctrl+f to find browscap and change its path e.g from
browscap="\xampp\php\extras\browscap.ini" to
browscap="E:\xampp\php\extras\browscap.ini"
Save the file and restart the xampp
try again with the composer installer
For the sake of google indexing,
I write the error I had
If Composer doesn't install in windows 7, 8, 10 with php provided in the xampp installation with this error message
The PHP exe file you specified did not run correctly:
yourPathTo\php.exe
The program failed to run correctly. Try reinstalling the program to fix this problem. Make sure you have installed the appropriate Visual C++ Redistributable.
The Composer message really confused me for the part of Visual C++, in fact it was not the case
Well, after long searches, I finally have found the Sarim' solution that you find in this same thread
Composer setup installation error
This specific issue is due to the php.ini which is default provided by the xampp installation which as highlighted by Sarim, does have paths relative to xampp installation and won't allow Composer-Setup.exe to properly run.
If you already have a composer and you need to update it, you can use this command line :
composer self-update
This working for me.
maybe if you were following how to install php guide such as this one it directs you to uncomment the extension_dir = [to your installation folder]. then if you install Composer it will give you the complaint.
Solution : comment the extension_dir line in you php.ini file and continue with your installation
I have mamp installed and am using windows 10. I have attached an image of the configurations, the error, and some of the things I've done to diagnose why. I don't know why I am continuously getting this composer error. I am updating my php.ini file, which had openssl commented out. I removed the semicolon on extension_dir (was already removed), and on extension=php_openssl.dll. I have noticed that when I type in php -m in my command prompt, I am not seeing open ssl, and I'm not sure how to enable that, if that is the possible issue.
If there can be any light shed on this, let me know, I understand this issue is answered hundreds of times over, but I have done what was required from those answers, and got no where.
Image clarifications: The error
Here is where I am checking the configurations with php -m and it's not showing openssl, correct me if I'm mistaken.
My phpinfo(); with also me doing php -ini, it's showing php isn't set, but it is when I run the phpinfo method, i'm assuming because this method is being run through mamp allowing it to set the correct parameters.
You have to make sure that the command-line PHP loads an ini file somehow. The easiest is probably to copy c:\MAMP\conf\php7.0.0\php.ini to wherever your php.exe is located. To find that out you can use where php which should return you the full path to it. Copy the ini file in that directory and it should find it and load the module (although you might have to adjust the extension_dir depending on how it is set).
See http://php.net/manual/en/configuration.file.php if you want more details on how the ini file is located.
you only need to copy php.ini from the conf directory to your php directory and it will work fine.
just copy php.ini from
MAMP/conf/php(version of your php)/php.ini
to
MAMP/bin/php/php(version of your php)
then try in command line `php composer.phar install'
for install composer and enable openssl extension, copy your php.conf in MAMP\conf\php{php-version} for MAMP\bin\php\php{php-version} and edit php.conf changing ;extension=php_openssl.dll for extension=php_openssl.dll.
Then try installing normally.
Running Windows 10 with MAMP PRO. Copy the version php.ini file to the folder that has the php.exe. In my case, I copied MAMP/conf/php7.2.1/php.ini file to MAMP/bin/php7.2.1/ folder.
Restarted MAMP PRO 4.
Ran the command line, replacing some-dir with my new Drupal 8 project.
composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction
Worked beautifully!
I'm trying to install composer to get laravel working.
Composer gave me the following 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
According to this post I need to uncomment the openssl extension.
composer not install in windows 7
The problem is I don't have a php.ini file in my php directory. There is a php.ini-development and php.ini-production. Do I just rename one of them to php.ini?
This post is in regards to XAMPP, it says that the php.ini file needs to be edited and not the php.ini-development or php.ini.production.
Php.ini production vs development
I downloaded the non-thread safe php x86 from here
http://windows.php.net/download/
Cheers
just copy paste php-development.ini and rename it to php.ini.
php 7.0.3 is already out!
use php.ini-development for your development server. use php.ini-production for your production server. Copy and rename it to php.ini
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.
I cannot install PHP-CURL on IIS. I think I have tried everything.
My phpinfo() output does not list cURL as available.
I have C:\PHP in my path and working correctly.
I have edited the registry to read from C:\PHP\php.ini. phpinfo() output shows the correct .ini path loaded.
I have uncommented 'extension=php_curl.dll'
I have ssleay32.dll and libeay32.dll availble in C:\PHP
Windows Server 2003
IIS 6
PHP 5.2.4
Try running:
php-cgi.exe -v
and see if any errors come up.
Also make sure the php is correctly in your path by going to the command line and typing:
echo %PATH%
As well make sure the php_curl.dll is in the correct directory and that ssleay32.dll and libeay32.dll are the same versions.
If all else fails try reinstalling PHP as I remember there being some issues a while back with the Curl Module not working on 5.1.4.
As well someone else mentioned installing the thread safe PHP package versus the non-thread package resolving a similar issue.
Did you definitely put php_curl.dll in the directory that PHP reads extensions from? Are the file permissions on it ok? And the big question: where did you get the php_curl.dll from? If you got a precompiled one it might be compiled for a different version of PHP than you are running. Check your webserver logs and see what comes up from PHP when you restart the server/container/whatever.