Reputation: 629
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.
Upvotes: 16
Views: 112553
Reputation: 144
xampp\php\php.ini
extension_dir
and change its relative path to
absolute path e.g from extension_dir="\ext"
to
extension_dir="E:\xampp\php\ext"
browscap
and change its path e.g frombrowscap="\xampp\php\extras\browscap.ini"
tobrowscap="E:\xampp\php\extras\browscap.ini"
Now try again with the composer installer.
Upvotes: 4
Reputation: 635
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
Upvotes: 0
Reputation: 5575
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.
Upvotes: 0
Reputation: 817
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.
php.ini
located in your "php" folder In my case it is in xampp the file is in c:\xampp\php\
"extension=php_openssl.dll"
";extension=php_openssl.dll"
uncomment by removing the semicolon ";"
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.
Upvotes: 25
Reputation: 508
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.
Upvotes: 0
Reputation: 629
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
Upvotes: 10