When managing multiple servers with varying operating systems and configurations, it can be challenging to identify the exact versions of your LAMP stack components. This guide provides a simple method to check the versions of Linux, Apache, MySQL, and PHP on your server.
Steps to Check the LAMP Version
1. Check the Linux Version
Run the following commands to determine your Linux distribution and version:
cat /etc/redhat-release uname -a
Sample Output:
Red Hat Enterprise Linux Server release 6.1 (Santiago) Linux node1.oriensoft.com 2.6.32-042stab032.1 #1 SMP Sat Aug 13 18:16:00 MSD 2011 x86_64 x86_64 x86_64 GNU/Linux
From the above, the Operating System is RHEL 6.1 (64-Bit).
2. Check the Apache Version
Run the command below to find the Apache version installed:.
httpd -v
Sample Output:
Server version: Apache/2.2.15 (Unix) Server built: Aug 14 2010 08:53:20
Here, the Apache version is 2.2.15.
3. Check the MySQL Version
Use the following command to check the installed MySQL version:
mysql -V
Sample Output:
mysql Ver 14.14 Distrib 5.1.47, for redhat-linux-gnu (x86_64) using readline 5.1
From the output, the MySQL version is 5.1.47 (64-Bit).
4. Check the PHP Version
Run the command below to find the PHP version:
php -v
Sample Output:
PHP 5.3.2 (cli) (built: Aug 17 2010 04:35:29) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
Here, the PHP version is 5.3.2.
Conclusion
By using the commands above, you can quickly determine the versions of the LAMP stack components installed on your server. Regularly checking and updating these versions ensures your server remains secure and optimised for performance.
For assistance or queries, contact the host.co.in team, available 24×7 to guide you.