在我的 Windows 10 的 shell 中找不到 PHP 命令,也没有在 git bash 中找到。我从这里尝试了所有可用的解决方案

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37962406/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 01:27:07  来源:igfitidea点击:

PHP command not found in my shell for windows 10 neither in git bash. I tried all the available solution from here

phpcommand-linexamppwindows-10

提问by Programmer Sishir

When I typed php in my command prompt, It results

当我在命令提示符中输入 php 时,结果是

C:\Users\samsung>php
'php' is not recognized as an internal or external command,
operable program or batch file.

I have installed xampp in my windows 10 and I haven't edited the php.ini file in the settings. Any help to enable this php command would be greatly appreciated because I am stock in my laravel composer setup due to this.

我已经在 Windows 10 中安装了 xampp,但我没有在设置中编辑 php.ini 文件。任何启用此 php 命令的帮助将不胜感激,因为因此我在 laravel 作曲家设置中有库存。

回答by David Rojo

You should add the php.exe path to PATH environment variable

您应该将 php.exe 路径添加到 PATH 环境变量

http://php.net/manual/en/faq.installation.php#faq.installation.addtopath

http://php.net/manual/en/faq.installation.php#faq.installation.addtopath