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.
在Windows命令行上找到PHP版本
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
15条回答 默认 最新
dougu4704 2013-03-20 07:39关注In command prompt type below
set PATH=%PATH%;C:\path\to\phpWhere C:\path\to\php is the folder where your
php.exefile is located. After this runC:\>php -vthan 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
WindowsiconStep 2 - Click on the
SettingsiconStep 3 - Click on
SystemStep 4 - Click on
AboutStep 5 - Click on
System infoStep 6 - Click on
Advanced system settingsStep 7 - Click on
Environment variables...Step 8 - Select
Pathrow and then clickEditStep 9 - Click
Newand 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♥Note: Replace your PHP installed path(e.g:
C:\Program Files\php) with the above path ♥.Step 10 - Click
OKand click everyOKbutton you will encounter to close every previous windows.本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报









