duanshai4484 2013-03-20 07:30
浏览 24
已采纳

在Windows命令行上找到PHP版本

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.

  • 写回答

15条回答 默认 最新

  • dougu4704 2013-03-20 07:39
    关注

    In command prompt type below

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

    Where C:\path\to\php 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

    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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(14条)

报告相同问题?

悬赏问题

  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程