Ubuntu – How to check the PHP and MySQL version on Ubuntu VPS

command-line-interfaceMySQLPHPUbuntu

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!

Best Answer

Do it from your command line:

php -v
mysql -V

and:

php -i | grep -i '^libxml'

OR

Put this in your root directory:

 <?php
    phpinfo();
 php?>

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