PHP to get server information implementation Code _php tutorial

Source: Internet
Author: User
Tags php server
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" "; Echo" "; Echo" "; Echo" "; Echo" "; Echo" "; Echo" "; Echo" "; Echo" "; Echo" "; Echo"

System Information

Web server: $sysos
PHP Version: $sysversion
MySQL version: $mysqlinfo
GD Library version: $gdinfo
FreeType: $freetype
Remote File Acquisition: $allowurl
Maximum upload limit: $max _upload
Maximum execution time: $max _ex_time
Server time: $systemtime
";
?>


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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.