'php' is not internal or external command.....

Discussion in 'PHP' started by rasana, Aug 21, 2008.

  1. #1
    Hi All,

    If I run php -v command to know php version on command line,
    it shows error like
    'php' is not recognized as an internal or external command, operable program or batch file'

    what does this error means?
    I'm using xampp server on windows
     
    rasana, Aug 21, 2008 IP
  2. minimalista

    minimalista Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That's because PHP is not in the path. You have to cd to the directory where it is installed and perform the php.com -v command

    you can find it by searching for php.com or php.ini. These two files should reside in a dir within xampp install dir

    cheers

    Zen
     
    minimalista, Aug 21, 2008 IP
  3. nice.wallpapers

    nice.wallpapers Active Member

    Messages:
    142
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Hi,

    You have 2 options to do that from command line:
    1) You have to use this command to set path :
    Step a) set PATH=%PATH%;C:\path\to\php
    after this pass the command :
    Step b) C:\>php -v
    out put will be like this:
    ----------------------------
    PHP 5.2.5 (cli) (built: Nov 8 2007 23:18:51)
    Copyright (c) 1997-2007 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
    with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
    with Xdebug v2.0.2, Copyright (c) 2002-2007, by Derick Rethans
    ----------------------------

    2) Go to that folder where php is installed from command line and pass the command "php.com -v" when you are in the same folder where php.com file is.
     
    nice.wallpapers, Aug 21, 2008 IP