在Windows命令行上查找PHP版本 [英] Find PHP version on windows command line

查看:307
本文介绍了在Windows命令行上查找PHP版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想通过Windows命令键入来了解我的PHP版本, C:\> php -v 但这是行不通的.它说php is not recognized as internal or external command.

I just tried to know version of my PHP from windows command typing, C:\> php -v But it is not working. It says php is not recognized as internal or external command.

推荐答案

在命令提示符下,键入以下

In command prompt type below

set PATH=%PATH%;C:\path\to\php

C:\ path \ to \ php是php.exe文件所在的文件夹.运行之后

Where C:\path\to\php is the folder where your php.exe file is located. After this run

C:\>php -v

比你会看到类似的东西

PHP 7.3.6 (cli) (built: May 29 2019 12:11:00) 


更新:

如果您发现重新启动计算机后,此解决方案将不再起作用:

If you find that when you restart your computer, this solution will not work anymore:

按如下所示设置路径:

步骤1 -单击Windows图标

第2步-单击Settings图标

第3步-单击System

步骤4 -单击About

步骤5 -单击System info

步骤6 -单击Advanced system settings

步骤7 -单击Environment variables...

步骤8 -选择Path行,然后单击Edit

Step 8 - Select Path row and then click Edit

步骤9 -单击New,然后单击Browse,然后在将打开的下一个面板中,您需要在Path中选择所需的文件夹.作为本指南的初始前提,我将添加文件夹C:\Users\NewFolderInPath

Step 9 - Click New and then click Browse, then in the next panel which will open you need to select the folder you want in the Path. For the initial premise of this guide i will add the folder C:\Users\NewFolderInPath

注意:用上面的路径♥替换您的PHP安装路径(例如:C:\Program Files\php).

Note: Replace your PHP installed path(e.g:C:\Program Files\php) with the above path ♥.

步骤10 -单击OK,然后单击您将遇到的每个OK按钮,以关闭以前的每个窗口.

Step 10 - Click OK and click every OK button you will encounter to close every previous windows.

这篇关于在Windows命令行上查找PHP版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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