[英]Installing Composer - Internal Error
I have trouble installing Composer
.我在安装Composer
遇到问题。 After I select the php.exe
path in the wizard and next thing it shows is the below error description.在向导中选择php.exe
路径后,它显示的下一件事是以下错误描述。
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.您指定的 PHP exe 文件未正确执行: D:\wamp\bin\php\php5.5.12\php.exe 从命令行运行它可能会突出问题。 Internal Error [ERR_INVALID], exit code 1内部错误 [ERR_INVALID],退出代码 1
I guess this is a problem which had been asked here .我想这是一个在这里被问到的问题。
composer not install in windows 7 作曲家未安装在 Windows 7 中
I figured it out and successfully installed Composer in My windows 10 PC.我想通了,并在我的 Windows 10 PC 中成功安装了 Composer。
I am sharing two solutions here.我在这里分享两个解决方案。
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\
查找并打开位于“php”文件夹中的php.ini
在我的情况下,它位于 xampp 中,文件位于c:\xampp\php\
"extension=php_openssl.dll"
找到"extension=php_openssl.dll"
";extension=php_openssl.dll"
uncomment by removing the semicolon ";"
";extension=php_openssl.dll"
通过删除分号";"
取消注释2nd solution(If the above solution didn't work for you then go with one below. )第二种解决方案(如果上述解决方案对您不起作用,请使用以下解决方案。)
This works in my case这适用于我的情况
php.ini
located in your "php" folder In my case it is in xampp the file is in c:\xampp\php\
查找并打开位于“php”文件夹中的php.ini
在我的情况下,它位于 xampp 中,文件位于c:\xampp\php\
php
in shell and hit enter在 shell 中编写php
并回车 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 in php.ini
file to solve the issue).然后你必须通过在你的php.ini
文件中注释所有这些扩展来修复这些警告消息。(实际上这些警告消息的原因是因为不止一次启用了这些扩展,但你可以在php.ini
文件中取消注释它以解决问题)。
For Example which is in my case.例如,在我的情况下。
a).一个)。 You can see in above image there is warning message for curl.您可以在上图中看到 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 ";"
b) 要解决此问题,请在php.ini
文件中找到php_curl.dll
文件并通过添加分号";"
来注释该扩展名in front of that extension like this ;extension=php_curl.dll
在像这样的;extension=php_curl.dll
Hope I can solve your issue .希望我能解决你的问题。
That's all folks .就是这样。 Happy coding !!!编码快乐!!! (amitamie.com) :-) ;-) (amitamie.com) :-) ;-)
There are some steps you might want to follow in order to solve your problem为了解决您的问题,您可能需要执行一些步骤
You can try to change extension_dir
in xampp\php\php.ini
to full direction like :您可以尝试将xampp\php\php.ini
中的extension_dir
更改为完整方向,例如:
extension_dir = "E:\xampp\php\ext"
Install it manually Is there any way to install Composer globally on Windows?手动安装有没有办法在 Windows 上全局安装 Composer? or you can do it by open XAMPP Shell and write this或者你可以通过打开 XAMPP Shell 并编写这个来做到这一点
php -r "readfile('https://getcomposer.org/installer');" | php
Just install it in C:\
partition, I think it will work .只需将它安装在C:\
分区中,我认为它会工作。
I think the problem its in the Windows8 and above that not give Full permission to use CMD
.我认为问题在于 Windows8 及更高版本没有完全允许使用CMD
。
This worked for me..,这对我有用..,
You are getting this error because some dll file which is specified in the php.ini is missing.您收到此错误是因为缺少 php.ini 中指定的某些 dll 文件。 So do the following steps to fix it.因此,请执行以下步骤来修复它。
Open command prompt and type php and hit enter.打开命令提示符并输入php并回车。
It will try to execute php and will throw warnings and errors.它将尝试执行 php 并抛出警告和错误。 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.现在,根据错误,继续并在 php.ini 文件中注释扩展名(在上面的命令中列出)。 For example in my case I commented extension=php_mysql.dll to ;extension=php_mysql.dll例如,在我的情况下,我将extension=php_mysql.dll 注释为 ;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.注意:如果不再重复该过程,可能是 php.ini 中的多个扩展在您的情况下造成了问题,但在 cmd 中,php 可能一次只给出一个错误。
Note: Once you have installed composer you can go ahead and uncomment all the line which you had commented.注意:一旦你安装了作曲家,你可以继续并取消你评论过的所有行。
There's following step you have to made.您必须执行以下步骤。
;extension=php_openssl.dll ;扩展=php_openssl.dll
add semi-colon in first and retry again to install composer首先添加分号,然后重试以安装作曲家
This works for me.这对我有用。
Drive_name://xampp/php
转到Drive_name://xampp/php
extension=msql.dll
to ;extension=msql.dll
and extension=msql.so
to ;extension=msql.so
将extension=msql.dll
更改为;extension=msql.dll
并将extension=msql.so
为;extension=msql.so
You need to install the "Visual C++"您需要安装“Visual C++”
https://www.microsoft.com/en-us/download/details.aspx?id=30679 https://www.microsoft.com/en-us/download/details.aspx?id=30679
This worked for me!这对我有用!
path/to/xampp/php
and open php.ini
转到path/to/xampp/php
并打开php.ini
extension=php_mcrypt.dll
and comment that by putting semicolon (;)
.搜索extension=php_mcrypt.dll
并通过输入分号(;)
对其进行注释。 Like Replace extension=php_mcrypt.dll
With ;extension=php_mcrypt.dll
就像将extension=php_mcrypt.dll
替换为;extension=php_mcrypt.dll
php.ini
保存php.ini
composer
again and it should work OK.现在尝试再次安装composer
,它应该可以正常工作。Go to your xampp\php\php.ini
转到您的xampp\php\php.ini
Press Ctrl + f to find extension=intl
and comment it out using ;
按Ctrl + f找到extension=intl
并使用;
将其注释掉
;extension=intl
Try and install your composer.exe.尝试安装您的 composer.exe。
This worked for me when I got this error: The PHP exe file you specified did not run correctly: C:\xampp\php\php.exe当我收到此错误时,这对我有用:您指定的 PHP exe 文件未正确运行:C:\xampp\php\php.exe
Program Output: PHP: syntax error, unexpected '(' in C:\xampp\php\php.ini on line 1602,程序输出:PHP:语法错误,第 1602 行 C:\xampp\php\php.ini 中出现意外的 '(',
After trying all the above answers: I open the php.ini file with a code editor and located line 1602 and I saw在尝试了以上所有答案之后:我用代码编辑器打开 php.ini 文件并找到第 1602 行,我看到了
error_reporting(1) around the eval().
so I commented on it using ;所以我用 ; 评论它
;error_reporting(1) around the eval().
and my composer installed successfully.我的作曲家安装成功。
There's no two ways about it.没有两种方法。 Just go to PHP.ini and comment the mention errors you have on your cmd or shell after typing PHP in it.simple as that problem solved.只需转到 PHP.ini 并在其中键入 PHP 后在 cmd 或 shell 上注释您提到的错误。这个问题解决了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.