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

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

问题描述

我只是想通过 windows 命令输入了解我的 PHP 版本,<代码>C:>php -v但它不起作用.它说 php 不被识别为内部或外部命令.

解决方案

在下面的命令提示符中输入

设置 PATH=%PATH%;C:path	ophp

其中 C:path ophp 是您的 php.exe 文件所在的文件夹.运行后

C:>php -v

你会看到类似的东西

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


更新:

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

如下设置路径:

<块引用>

第 1 步 - 点击 Windows 图标

<块引用>

第 2 步 - 点击 Settings 图标

<块引用>

第三步 - 点击系统

<块引用>

第四步 - 点击About

<块引用>

第五步 - 点击系统信息

<块引用>

第 6 步 - 点击高级系统设置

<块引用>

第 7 步 - 点击环境变量...

<块引用>

第 8 步 - 选择 Path 行,然后点击 Edit

<块引用>

第 9 步 - 点击 New,然后点击 Browse,然后在下一个打开的面板中,您需要选择所需的文件夹在 路径 中.对于本指南的初始前提,我将添加文件夹 C:UsersNewFolderInPath

注意:将您的PHP安装路径(例如:C:Program Filesphp)替换为上述路径♥.

<块引用>

第 10 步 - 单击 OK 并单击您将遇到的每个 OK 按钮以关闭之前的所有窗口.

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	ophp

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

C:>php -v

than you will see something like

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


UPDATE:

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

Set the Path like as following:

Step 1 - Click on the Windows icon

Step 2 - Click on the Settings icon

Step 3 - Click on System

Step 4 - Click on About

Step 5 - Click on System info

Step 6 - Click on Advanced system settings

Step 7 - Click on Environment variables...

Step 8 - Select Path row and then click Edit

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:UsersNewFolderInPath

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

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

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

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