在Windows命令行上查找PHP版本 [英] Find PHP version on windows command line
问题描述
我只是想通过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 clickEdit
步骤9 -单击
New
,然后单击Browse
,然后在将打开的下一个面板中,您需要在Path
中选择所需的文件夹.作为本指南的初始前提,我将添加文件夹C:\Users\NewFolderInPath
♥
Step 9 - Click
New
and then clickBrowse
, then in the next panel which will open you need to select the folder you want in thePath
. For the initial premise of this guide i will add the folderC:\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 everyOK
button you will encounter to close every previous windows.
这篇关于在Windows命令行上查找PHP版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!