当我使用php
运行命令时出现以下错误
C:\xampp\htdocs>php
'php' is not recognized as an internal or external command,
operable program or batch file.
当我在以下路径中使用php
运行命令时,我没有收到任何错误:
C:\xampp\php>php //do not got error here
为什么我会收到此错误?
'php'不被识别为内部或外部命令,可操作程序或批处理文件。
将C:\xampp\php
添加到PATH
环境变量中。
然后关闭命令提示符并重新启动。
这非常重要,因为如果不重新启动命令提示符,则不会反映更改。
在PATH环境变量中设置"C:\xampp\php"
。然后重启CMD提示符。
你需要将C:\xampp\php
添加到你的PATH Environment Variable
,只有在那之后你才能从php
外面执行php_home
命令行。
当我使用PHP
运行命令时,我也遇到以下错误,我做了这样的解决方案:
C:\xampp\php
添加到PATH环境变量中。非常重要的说明:重启命令提示符
这就是我在MY PC上做的事情我安装了我通常在G中使用的所有软件:partian而不是C:如果我的操作系统是跌倒(赢10),不需要重新安装它们并且浪费时间,那么windows如何工作它更新如果你安装任何新的程序或软件pice,PATH会自动运行,
所以
我必须在这里更新PATH!我经常使用的所有软件
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;G:\HashiCorp\Vagrant\bin;G:\xampp\php;G:\xampp\mysql\bin;G:\Program Files (x86)\heroku\bin;G:\Program Files (x86)\Git\bin;G:\Program Files (x86)\composer;G:\Program Files (x86)\nodejs;G:\Program Files (x86)\Sublime Text 3;G:\Program Files (x86)\Microsoft VS Code\bin;G:\Program Files (x86)\cygwin64\bin