Copy Code code as follows:
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> Get Server information </title>
<body>
<?php
$sysos = $_server["Server_software"]; To get a string of server identities
$sysversion = php_version; Get PHP Server version
The following two code connects the MySQL database and gets the MySQL database version information
mysql_connect ("localhost", "Mysql_user", "Mysql_pass");
$mysqlinfo = Mysql_get_server_info ();
Get information from the GD library from the server
if (function_exists ("Gd_info")) {
$GD = Gd_info ();
$gdinfo = $GD [' gd Version '];
}else {
$gdinfo = "Unknown";
}
See if FreeType fonts are supported from the GD library
$freetype = $GD ["FreeType Support"]? "Support": "Not supported";
Whether you can obtain remote file access from the PHP configuration file
$allowurl = Ini_get ("Allow_url_fopen")? "Support": "Not supported";
Get maximum upload limit from PHP configuration file
$max _upload = Ini_get ("File_uploads")? Ini_get ("Upload_max_filesize"): "Disabled";
Get the maximum execution time for a script from a PHP configuration file
$max _ex_time= ini_get ("Max_execution_time"). " Seconds ";
The following two gets the server time, the Chinese mainland uses is the East eight area time, sets the time zone to write etc/gmt-8
Date_default_timezone_set ("etc/gmt-8");
$systemtime = Date ("Y-m-d h:i:s", Time ());
/* ******************************************************************* */
/* Export the above server information to the client browser as an HTML form.
/* ******************************************************************* */
echo "<table align=center cellspacing=0 cellpadding=0>";
echo "<caption> echo "<tr> <td> Web server: </td> <td> $sysos </td> </tr>";
echo "<tr> <td> PHP Version: </td> <td> $sysversion </td> </tr>";
echo "<tr> <td> mysql version: </td> <td> $mysqlinfo </td> </tr>";
echo "<tr> <td> GD library version: </td> <td> $gdinfo </td> </tr>";
echo "<tr> <td> FreeType: </td> <td> $freetype </td> </tr>";
echo "<tr> <td> remote file acquisition: </td> <td> $allowurl </td> </tr>";
echo "<tr> <td> maximum upload limit: </td> <td> $max _upload </td> </tr>";
echo "<tr> <td> Maximum execution time: </td> <td> $max _ex_time </td> </tr>";
echo "<tr> <td> server time: </td> <td> $systemtime </td> </tr>";
echo "</table>";
?>
<body>