Monday, 14 May 2018

How to check PHP version in Centos 7



To verify the installation and version of installed PHP by checking the version of PHP using command or inbuilt phpinfo() function in php.


Run the following command to find out PHP version using command:

[root@linuxcnf ~]# php –v
PHP 5.6.32 (cli) (built: Oct 29 2017 14:02:30)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies [root@linuxcnf ~]# 

To check the PHP version from the web browser: create a file info.php in the web server's document root and Paste the following code. By default, on Apache, this would be:

[root@linuxcnf ~]#  cd /var/www/html/
[root@ linuxcnf html]# vi info.php
<?php
 phpinfo();
?>
[root@ linuxcnf html]#


Save and quit the file info.php. Now, visit http://server-url/info.php






Installed PHP version display like above screenshot!!!

No comments:

Post a comment