46

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!

3 Answers 3

81

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)

1
  • 2
    Using mysql -V can return with unexpected errors due to permissions. Jun 6, 2017 at 17:43
10

Use dpkg to find the installed package versions.

dpkg -l | grep '\(php\|mysql\)'
1
  • Returns nothing if compile from source.
    – quanta
    Aug 1, 2011 at 5:00
3

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

SELECT VERSION();

SHOW VARIABLES LIKE 'version';

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.

1
  • ERROR 3167 (HY000): The 'INFORMATION_SCHEMA.GLOBAL_VARIABLES' feature is disabled; see the documentation for 'show_compatibility_56'
    – Pathros
    Dec 12, 2020 at 19:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .