在命令提示符中,php不被识别为内部或外部命令 [英] php is not recognized as an internal or external command in command prompt

查看:2753
本文介绍了在命令提示符中,php不被识别为内部或外部命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用 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 环境变量。然后关闭命令提示符并重新重新启动。 它很重要,因为如果您没有重新启动命令提示符,则更改将不会反映。谢谢。

Add C:\xampp\php to your PATH Environment Variable. Then Close The Command Prompt And Restart Again. Its important because if you didn't restart you command prompt then changes will not reflect.Thanks.

这篇关于在命令提示符中,php不被识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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