我需要知道准确的MySQL版本,用于magento安装检查。
我从这里得到了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);,但我如何才能得到精确的版本
发布于 2015-08-16 05:44:13
http://php.net/manual/en/function.phpversion.php
printf("PHP版本:%s\n",phpversion());
或http://php.net/manual/en/reserved.constants.php#reserved.constants.core
只是:
printf(“PHP_VERSION:%s\n",PHP_VERSION);
发布于 2015-08-16 05:43:29
您可以使用PHP完成此操作,只需使用以下脚本,它将在页面上显示所有PHP信息:
<?php
phpinfo();
?>或者,如果您只想要PHP版本而不需要所有这些,那么:
<?php
echo "PHP version is: " . phpversion();
?>发布于 2015-08-20 06:43:18
php中有两个函数可以获得PHP和MySql的精确版本。
参考:
https://stackoverflow.com/questions/32032195
复制相似问题