命令 'php' 无法识别,但已在 Windows PATH 中注册 [英] Command 'php' not recognized but it is registered in Windows PATH

查看:58
本文介绍了命令 'php' 无法识别,但已在 Windows PATH 中注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 服务器上的 PATH 字符串中设置了C:\Ampps\php",但是当我在 PHPStorm 终端上输入php"时,我总是得到 php"不被识别为内部或外部命令、可运行的程序或批处理文件.

I have "C:\Ampps\php" setup in the PATH string on my Windows server but when I type 'php' on the PHPStorm terminal I'm always given 'php' is not recognized as an internal or external command, operable program or batch file.

这是 PHPStorm 7.1.3 的错误吗?如果我在外部打开一个新的命令提示符窗口,它可以从命令行工作.

Is this a bug with PHPStorm 7.1.3? It works from the command line if I open a new Command Prompt window externally.

推荐答案

对于任何在 PhpStrom 中遇到此类问题的新读者,只需直接从 PhpStrom 终端设置路径

For any new readers facing such problem in PhpStrom just set path directly from PhpStrom terminal

set path=%path%;c:/xammps/PHP

不建议从 xammps 或其他此类程序中使用 PHP,因为它将是您的工作 PHP 目录,如果它被删除,那么您必须执行另一项任务来处理它,否则 Windows 中可能会弹出一些错误,只需安装一个新版本的 PHP 中有很多适用于 Windows 的教程.

Not recommended to use PHP from xammps or other such programs since it will be your working PHP directory and if it gets deleted then you have to perform another task to handle it or some errors might pop up in windows just install a fresh version of PHP lots of tutorials are out there for Windows.

但是要在来自 xammps 的 PhpStrom 终端中使用 PHP,只需运行该命令,它将设置 PhpStrom 可以找到的路径.

But nevertheless to use PHP in PhpStrom Terminal from xammps just run that command it will set the path that PhpStrom can find.

这篇关于命令 'php' 无法识别,但已在 Windows PATH 中注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆