![](/img/trans.png)
[英]'“php.exe”' is not recognized as an internal or external command, operable program or batch file
[英]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.'
我為本地 Drupal 開發安裝了 Acquia Dev Desktop 2,它附帶 PHP 和一些工具,如 composer 和 drush。 但是,當我運行作曲家時,它給了我錯誤:
'php.exe' is not recognized as an internal or external command,
operable program or batch file.
我已經在這里看到了許多其他類似的問題,普遍認為 php 需要添加到 PATH 中。 但是,我已經完成了這個添加:
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. 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. 我嘗試了很多其他變體,但無濟於事。
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'
我不知道要采取什么步驟,所以任何見解都將不勝感激!
D'oh,需要重新啟動我的計算機。 非常感謝李健!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.