PHP is not recognized as an internal or external command in command prompt(PHP 在命令提示符中未被识别为内部或外部命令)
问题描述
当我使用 php
C:xampphtdocs>php
'php' is not recognized as an internal or external command,
operable program or batch file.
在以下路径中使用 php 运行命令时没有出现任何错误:
I don't get any error when I run the command with php in following path:
C:xamppphp>php //do not got error here
为什么会出现这个错误?
Why I get this error?
'php' 不是内部或外部命令,也不是可运行的程序或批处理文件.
'php' is not recognized as an internal or external command, operable program or batch file.
推荐答案
将 C:xamppphp 添加到您的 PATH 环境变量中.(My Computer->属性->高级系统设置->环境变量->编辑路径)
Add C:xamppphp to your PATH environment variable.(My Computer->properties -> Advanced system setting-> Environment Variables->edit path)
然后关闭命令提示符并重新启动.
Then close your command prompt and restart again.
注意:关闭命令提示符并重新启动非常重要,否则将不会反映更改.
Note: It's very important to close your command prompt and restart again otherwise changes will not be reflected.
这篇关于PHP 在命令提示符中未被识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHP 在命令提示符中未被识别为内部或外部命令
基础教程推荐
- 在PHP中根据W3C规范Unicode 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何替换eregi() 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
