A quick way to test this is type the following from the command line.
$ php -v
This should result in something like the following message:
PHP 4.3.6 (cli) (built: Apr 19 2004 10:02:14)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
Note the (cli) above -- if instead you see "(cgi)", don't worry. The CGI binary can be told to behave like the CLI binary when it's used, but you need to be aware there's a difference. I'll look at solving compatibility issues between the two, as well as older PHP versions, at the end of this article.
-from
PHP on the Command Line