[英]When I run composer on Windows, I get an error of 'php.exe' is not recognized as an internal or external command, operable program or batch file.'
I have an install of Acquia Dev Desktop 2 for local Drupal development, which comes with PHP and some tools like composer and drush.我为本地 Drupal 开发安装了 Acquia Dev Desktop 2,它附带 PHP 和一些工具,如 composer 和 drush。 However, when I run composer, it gives me the error:
但是,当我运行作曲家时,它给了我错误:
'php.exe' is not recognized as an internal or external command,
operable program or batch file.
I have already seen many other similar questions on here, which universally say that php needs to be added to the PATH.我已经在这里看到了许多其他类似的问题,普遍认为 php 需要添加到 PATH 中。 However, I have already done this adding:
但是,我已经完成了这个添加:
C:\Program Files (x86)\DevDesktop\php7_3_x64
C:\Program Files (x86)\DevDesktop\tools //contains Composer and Drush
This results in me being able to run php and php.exe from Git Bash fine, but if I try composer the aforementioned error still crops up. This results in me being able to run php and php.exe from Git Bash fine, but if I try composer the aforementioned error still crops up. It's not working on Powershell, cmd or git bash for windows, but I am in particular trying to get it to work on Git Bash so here is my.bashrc.
It's not working on Powershell, cmd or git bash for windows, but I am in particular trying to get it to work on Git Bash so here is my.bashrc. I've tried lots of other variations, but to no avail.
我尝试了很多其他变体,但无济于事。
alias php='php.exe'
alias php.exe=\'C:/Program\ Files\ \(x86\)\\DevDesktop\\php7_3_x64\\php.exe\'
alias drush='drush.bat'
alias composer='composer.bat'
I'm at a loss on what steps to take, so any insight would be greatly appreciated!我不知道要采取什么步骤,所以任何见解都将不胜感激!
D'oh, needed to restart my computer. D'oh,需要重新启动我的计算机。 Many thanks to Ken Lee!
非常感谢李健!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.