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.
> more /etc/issue
> lsb_release -a
> /usr/sbin/apache2 -V
Note: Apache 2 doesn't have "httpd" anymore. It was changed to "apache2" instead.
First log into your MySQL database from the command line, using something to the effect of:
> mysql -u username -p
mysql> select version();
> php -v
> 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.