Copy CodeThe code is as follows:
<title>Get Server information</title>
$sysos = $_server["Server_software"]; Gets the string for the server identity
$sysversion = php_version; Get PHP Server version
The following two code connects to MySQL database and obtains MySQL database version information
mysql_connect ("localhost", "Mysql_user", "Mysql_pass");
$mysqlinfo = Mysql_get_server_info ();
Get information about 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";
Get the remote file 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";
To get the maximum execution time of a script from a PHP configuration file
$max _ex_time= ini_get ("Max_execution_time"). " Seconds ";
The following two get server time, Mainland China is using the time of the East Eight, set the timezone to write etc/gmt-8
Date_default_timezone_set ("etc/gmt-8");
$systemtime = Date ("Y-m-d h:i:s", Time ());
/* ******************************************************************* */
/* Output The server information obtained above to the client browser as an HTML table */
/* ******************************************************************* */
echo "
"; Echo"
System Information
"; Echo"
Web server: |
$sysos |
"; Echo"
PHP Version: |
$sysversion |
"; Echo"
MySQL version: |
$mysqlinfo |
"; Echo"
GD Library version: |
$gdinfo |
"; Echo"
FreeType: |
$freetype |
"; Echo"
Remote File Acquisition: |
$allowurl |
"; Echo"
Maximum upload limit: |
$max _upload |
"; Echo"
Maximum execution time: |
$max _ex_time |
"; Echo"
Server time: |
$systemtime |
"; Echo"
";
?>
http://www.bkjia.com/PHPjc/326463.html www.bkjia.com true http://www.bkjia.com/PHPjc/326463.html techarticle Copy the code as follows: HTML head meta http-equiv= "Content-type" content= "text/html; charset=gb2312" title Get server information/title/head Body? php $sysos = $_server["server_s ...