Home  >  Article  >  Backend Development  >  PHP implementation code to obtain server information_PHP tutorial

PHP implementation code to obtain server information_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:13:37853browse

Copy code The code is as follows:




Get server information


$sysos = $_SERVER["SERVER_SOFTWARE"]; //Get the string of server identification
$sysversion = PHP_VERSION; //Get the PHP server version
//The following two codes Connect to the MySQL database and obtain the MySQL database version information
mysql_connect("localhost", "mysql_user", "mysql_pass");
$mysqlinfo = mysql_get_server_info();
//Get the GD library information from the server
if(function_exists("gd_info")){ "Unknown";
}
//Check whether FreeType fonts are supported from the GD library
$freetype = $gd["FreeType Support"] ? "Support" : "Not supported";
/ /Get whether remote file acquisition is possible from the PHP configuration file
$allowurl= ini_get("allow_url_fopen") ? "Supported" : "Not supported";
//Get the maximum upload limit from the PHP configuration file
$max_upload = ini_get("file_uploads") ? ini_get("upload_max_filesize") : "Disabled";
//Get the maximum execution time of the script from the PHP configuration file
$max_ex_time= ini_get("max_execution_time") ."seconds";
//The following two methods are used to obtain the server time. Mainland China uses the time of the East Eighth District. The setting time zone is written as 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 in the form of an HTML table */
/* ********************** ***************************************** */
echo " ";
echo "";
echo " Web server: ";
echo "";
echo "";
echo "";
echo " Remote file acquisition: ";
echo " < ;td> $max_upload ";
echo "";
echo "";
echo "

System Information

$sysos
PHP version: td> $sysversion
MySQL version: $mysqlinfo
GD library version: $gdinfo 🎜>echo "
FreeType: $freetype
$allowurl
Maximum upload limit:
Maximum execution time: $max_ex_time
Server time: $systemtime
";
?>







http://www.bkjia.com/PHPjc/326463.html
www.bkjia.com

truehttp: //www.bkjia.com/PHPjc/326463.htmlTechArticleCopy 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...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn