To Find Out Version of LAMP (Linux, Apache, MySQL, PHP) Via the Command Line

I am running a LAMP server on Slicehost. I always have to look up how to determine the version of each component of the LAMP server I am running. I am using Ubuntu Linux 8.04.4 (Hardy). In my case, here are the command-line instructions I use. I hope this helps you too. Btw, the command “whereis” is very helpful in locating programs (i.e. whereis apache2).

Linux

> more /etc/issue

or

> lsb_release -a

Apache 2

> /usr/sbin/apache2 -V

Note: Apache 2 doesn’t have “httpd” anymore. It was changed to “apache2″ instead.

MySQL

First log into your MySQL database from the command line, using something to the effect of:

> mysql -u username -p

Then:

mysql> select version();

PHP

> php -v

or

> php5 -v

Note: This assumes you have PHP 5 installed and that you have installed the Command Line Interface (CLI) to PHP via “sudo aptitude install php5-cli”. Alternatively, you can find out the version of PHP via instruction “< ? phpinfo() ?>” within a .php file.

This entry was posted in Development, Linux, Software, Technology, Uncategorized and tagged , , , , , . Bookmark the permalink.

6 Responses to To Find Out Version of LAMP (Linux, Apache, MySQL, PHP) Via the Command Line

  1. I am also using Ubantu Linux system.
    Commandline Instructions provide by you are really helps me.
    Thanks for sharing!

  2. I’m also using Linux Ubantu.
    Command Line instructions that you really are helping me.
    Thank you for sharing!

  3. Thank you for sharing Control Range guidelines that you really are assisting me.

  4. Thank you for giving Management Variety suggestions that you really are helping me.

  5. I am also use in Linux system. thanks for share your control range guide it’s very well helpful me. Thanks for sharing

  6. GarrettOneal says:

    Hi the article is very informative it’s fantastic. Thank you very much for sharing.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>