Aside from using phpinfo(), you can also use some shell commands to view the apache or php versions you are using.

NOTE: This is in CentOS 5.

Syntax to get Apache Version

httpd -v

Sample:
[root@vps ~]# httpd -v
Server version: Apache/2.2.3
Server built: May 28 2009 12:50:07

Syntax to get PHP Version

php -v

Sample:

[root@host ~]# php -v
PHP 5.0.5 (cli) (built: Apr 26 2006 09:47:41)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.5, Copyright (c) 1998-2004 Zend Technologies

One Thought on “How to Get Apache & PHP version in Shell

  1. Pingback: Upgrading to PHP 5.3

Post Navigation