gpt4 book ai didi

php - 在 Windows 命令行上查找 PHP 版本

转载 作者:IT王子 更新时间:2023-10-28 23:57:42 25 4
gpt4 key购买 nike

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

最佳答案

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

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

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

C:\>php -v

你会看到类似的东西

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

更新:

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

如下设置路径:

Step 1 - Click on the Windows icon

enter image description here

Step 2 - Click on the Settings icon

enter image description here

Step 3 - Click on System

enter image description here

Step 4 - Click on About

enter image description here

Step 5 - Click on System info

enter image description here

Step 6 - Click on Advanced system settings

enter image description here

Step 7 - Click on Environment variables...

enter image description here

Step 8 - Select Path row and then click Edit

enter image description here

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

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

enter image description here

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

enter image description here

关于php - 在 Windows 命令行上查找 PHP 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15517718/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com