Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

HI I am going to install MyBB but I am not sure whether I have installed the correct version of PHP and MySQL.

PHP version 5.1.0 or above with XML Extension installed

MySQL version 4.0 or above

How to check that? Especiall the PHP XML Extension?

Is there simpler way than the <?php phpinfo() ?> solution? I am expecting a command line solution.

Thanks a lot!

share|improve this question
up vote 34 down vote accepted

Do it from your command line:

php -v
mysql -V


php -i | grep -i '^libxml'


Put this in your root directory:


Save it as phpinfo.php and point your browser to it (this could be http://localhost/phpinfo.php)

share|improve this answer

Use dpkg to find the installed package versions.

dpkg -l | grep '\(php\|mysql\)'
share|improve this answer
Returns nothing if compile from source. – quanta Aug 1 '11 at 5:00

Any one of these queries will tell you what the MySQL version running is once connected:



This works for MySQL 5.1+

SELECT variable_value FROM information_schema.global_variables
WHERE variable_name='version';

Doing the following from the command line:

mysql -V will get you the version of the client.

mysqld -V will get you the version of the server.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.