我需要知道用于 magento 安装检查的 PHP 和 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 版本
最佳答案
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 版本: %s\n", PHP_VERSION);
关于php - 来自 PHP 脚本的 PHP 和 MySQL 的确切版本是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32032195/