'Installing Composer - Internal Error
I have trouble installing Composer
. After I select the php.exe
path in the wizard and next thing it shows is the below error description.
The PHP exe file you specified did not execute correctly: D:\wamp\bin\php\php5.5.12\php.exe Running it from the command line might highlight the problem. Internal Error [ERR_INVALID], exit code 1
Solution 1:[1]
I guess this is a problem which had been asked here .
composer not install in windows 7
I figured it out and successfully installed Composer in My windows 10 PC.
I am sharing two solutions here.
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 inc:\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 didn't work for you then go with one below. )
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 inc:\xampp\php\
- Open SHELL from Xampp start panel by clicking on shell button.
- Write
php
in shell and hit enter - If you get some warning message in your shell that looks like the image below:
Then you have to fix these warning message by commenting all these extension in your
php.ini
file.(Actually cause of these warning messages are because more than one time these extensions are enabled but you can un-comment it inphp.ini
file to solve the issue).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 yourphp.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 until 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.
Hope I can solve your issue .
That's all folks . Happy coding !!! (amitamie.com) :-) ;-)
Solution 2:[2]
There are some steps you might want to follow in order to solve your problem
You can try to change
extension_dir
inxampp\php\php.ini
to full direction like :extension_dir = "E:\xampp\php\ext"
Install it manually Is there any way to install Composer globally on Windows? or you can do it by open XAMPP Shell and write this
php -r "readfile('https://getcomposer.org/installer');" | php
Just install it in
C:\
partition, I think it will work .
I think the problem its in the Windows8 and above that not give Full permission to use CMD
.
Solution 3:[3]
This worked for me..,
- Open xampp>apache>PHP(php.ini)
- Search for openssl
- Comment on extension=openssl by adding ; at the beggining
Solution 4:[4]
You are getting this error because some dll file which is specified in the php.ini is missing. So do the following steps to fix it.
Open command prompt and type php and hit enter.
It will try to execute php and will throw warnings and errors. For example in my case it was like below: Error
Now, based on the error, go ahead and comment the extension (listed in the above command) in php.ini file. For example in my case I commented extension=php_mysql.dll to ;extension=php_mysql.dll
Now try to install the composer again, it should work.
Note: If not repeat the process again, may be there are more then one extensions in php.ini are creating the problem in your case, but at cmd, php might give only one error at once.
Note: Once you have installed composer you can go ahead and uncomment all the line which you had commented.
Solution 5:[5]
There's following step you have to made.
- Go to C://xampp/php
- open php.ini and search for "openssl" (Two search may Found!)
;extension=php_openssl.dll
add semi-colon in first and retry again to install composer
Solution 6:[6]
This works for me.
- Go to
Drive_name://xampp/php
- Open php.ini and search for "msql.so" and "msql.dll"
- Change
extension=msql.dll
to;extension=msql.dll
andextension=msql.so
to;extension=msql.so
Solution 7:[7]
You need to install the "Visual C++"
https://www.microsoft.com/en-us/download/details.aspx?id=30679
Solution 8:[8]
This worked for me!
- Go to
path/to/xampp/php
and openphp.ini
- Search for
extension=php_mcrypt.dll
and comment that by putting semicolon(;)
. Like Replaceextension=php_mcrypt.dll
With;extension=php_mcrypt.dll
- Save
php.ini
Now Try to installcomposer
again and it should work OK.
Solution 9:[9]
Go to your xampp\php\php.ini
Press Ctrl+f to find extension=intl
and comment it out using ;
;extension=intl
Try and install your composer.exe.
Solution 10:[10]
This worked for me when I got this error: The PHP exe file you specified did not run correctly: C:\xampp\php\php.exe
Program Output: PHP: syntax error, unexpected '(' in C:\xampp\php\php.ini on line 1602,
After trying all the above answers: I open the php.ini file with a code editor and located line 1602 and I saw
error_reporting(1) around the eval().
so I commented on it using ;
;error_reporting(1) around the eval().
and my composer installed successfully.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow