什么精确版PHP和&来自PHP脚本的MySQL?

时间:2015-08-16 05:39:51

标签: php mysql apache server version

我需要知道确切版本PHP&用于magento安装检查的MySQL

我从这里获得MySQl版本:

//Test What Exact Version PHP & MySQL

echo "<h2>Exact Version PHP & MySQL: </h2>";

$mysql = mysqli_connect('localhost', 'root', ''); 
/* Test the MySQL connection */
if (mysqli_connect_errno()) {
printf("Connection failed: %s\n", mysqli_connect_error());
exit();
}

/* Print the MySQL server version */
printf("MySQL server version: %s\n", mysqli_get_server_info($mysql));

/* Close the MySQL connection */
mysqli_close($mysql);

但我怎样才能获得精确的PHP版本

1 个答案:

答案 0 :(得分:0)

php中有两个函数可以获得PHP和MySql的确切版本。

  • 对于PHP版本

    phpversion();
    
  • 对于MySql版本

    mysql_get_server_info();
    

价:

http://php.net/manual/en/function.phpversion.php

http://php.net/manual/en/function.mysql-get-server-info.php