Verify Apache, PHP, MySQL versions already installed

Apache Version

You may need to check which version of Apache is installed on your web server. The httpd command can be used to find Apache version on Windows as well as Linux.

# httpd -v

If the path to Apache bin directory is added to the path variable you may execute the command from anywhere. If the command is not being recognized you have to navigate to the directory where Apache is installed.



C:\Myfolder\Apache24\bin> httpd -v
Server version: Apache/2.4.18 (Win64)
Apache Lounge VC11 Server built:   Dec 11 2015 13:02:26

To get a list of loaded modules use the command

# httpd -M

PHP version

The function phpinfo() can be used to check php version. To do this, create a file called test.php in the document root folder. Open in text editor and add the following code.

<?php
phpinfo();
?>

If you open http://localhost/test.php from a web browser this shows the currently installed PHP version and details.

MySQL

Go to the MySQL bin directory. Issue the command mysql -V

c:\Program Files\MySQL\MySQL Server 5.6\bin> mysql -V
mysql  Ver 14.14 Distrib 5.6.28, for Win64 (x86_64)

Alternately login to the database and use SHOW VARIABLES LIKE 'version'

c:\Program Files\MySQL\MySQL Server 5.6\bin> mysql -u cakeuser -p
Enter password: ********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.6.28-log MySQL Community Server (GPL)
mysql> SHOW VARIABLES LIKE 'version';
+---------------+------------+
| Variable_name | Value      |
+---------------+------------+
| version       | 5.6.28-log |
+---------------+------------+
1 row in set (0.00 sec)

Post a comment

Name

Your Comment

Email (We dont publish it)

Comments

Nothing yet..be the first to share wisdom.