To find out php version installed on the server type the following commands:
$ php --version
OR
$ php-cgi --version
OR
$ php5-cgi --version
OR
$ php5 --version
Sample output
PHP 5.3.3 (cgi-fcgi) (built: Jun 25 2012 04:38:39)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
I do not have SSH based access to my hosting server
If you can not login to your server using ssh commmand. Create a php script as follows (myversion.php):
<?php // program to tell php version using ftp client phpinfo(); ?>
Upload the above file using ftp client and type the url:
http://your-domain-name-here/myversion.php
OR
http://your-domain-name-here/path/to/myversion.php
Sample outputs:
Using package manager
Type the following command on RHEL / Red Hat / CentOS / Fedora Linux based system to find out php version:
$ yum info php
Sample outputs:
Loaded plugins: auto-update-debuginfo, protectbase, rhnplugin 0 packages excluded due to repository protections Installed Packages Name : php Arch : x86_64 Version : 5.3.3 Release : 14.el6_3 Size : 3.5 M Repo : installed From repo : rhel-x86_64-server-6 Summary : PHP scripting language for creating dynamic web sites URL : http://www.php.net/ License : PHP Description : PHP is an HTML-embedded scripting language. PHP attempts to make it : easy for developers to write dynamically generated webpages. PHP also : offers built-in database integration for several commercial and : non-commercial database management systems, so writing a : database-enabled webpage with PHP is fairly simple. The most common : use of PHP coding is probably as a replacement for CGI scripts. : : The php package contains the module which adds support for the PHP : language to Apache HTTP Server.
OR just list packages:
$ rpm -qa | grep php
If you are using Debian / Ubuntu Linux based system, type the following command to find out php version:
$ dpkg --list | grep php
Sample outputs:
ii libapache2-mod-php5 5.3.3-7+squeeze14 server-side, HTML-embedded scripting language (Apache 2 module) ii php5 5.3.3-7+squeeze14 server-side, HTML-embedded scripting language (metapackage) ii php5-cgi 5.3.3-7+squeeze14 server-side, HTML-embedded scripting language (CGI binary) ii php5-cli 5.3.3-7+squeeze14 command-line interpreter for the php5 scripting language ii php5-common 5.3.3-7+squeeze14 Common files for packages built from the php5 source ii php5-gd 5.3.3-7+squeeze14 GD module for php5 ii php5-mysql 5.3.3-7+squeeze14 MySQL module for php5 ii php5-suhosin 0.9.32.1-1 advanced protection module for php5
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 0 comments… add one now }