PHP getting server information function _ PHP Tutorial

Source: Internet
Author: User
PHP functions for obtaining server information. The code is as follows: Copy the code *** get system information *** @ returnarray * functiongetSystemInfo () {$ systemInfoarray (); System $ systemInfo [OS] PHP_ OS; PHP version $ systemIn
The code is as follows:

/**
* Obtain system information
*
* @ Return array
*/
Function getSystemInfo ()
{
$ SystemInfo = array ();

// System
$ SystemInfo ['OS'] = PHP_ OS;

// PHP version
$ SystemInfo ['phpversion'] = PHP_VERSION;

// Apache version
$ SystemInfo ['apacheversion'] = apache_get_version ();

// ZEND version
$ SystemInfo ['zendversion'] = zend_version ();

// GD related
If (function_exists ('gd _ info '))
{
$ GdInfo = gd_info ();
$ SystemInfo ['gdsupport '] = true;
$ SystemInfo ['gdversion'] = $ gdInfo ['gd version'];
}
Else
{
$ SystemInfo ['gdsupport '] = false;
$ SystemInfo ['gdversion'] = '';
}

// Security mode
$ SystemInfo ['safemode'] = ini_get ('safe _ mode ');

// Register global variables
$ SystemInfo ['registerglobals'] = ini_get ('register _ globals ');

// Enable Magic reference
$ SystemInfo ['magicquotes '] = (function_exists ("get_magic_quotes_gpc") & get_magic_quotes_gpc ());

// Maximum size of uploaded files
$ SystemInfo ['maxuploadfile'] = ini_get ('upload _ max_filesize ');

// Maximum memory occupied by script running
$ SystemInfo ['memorylimit '] = get_cmd_var ("memory_limit ")? Get_cmd_var ("memory_limit "):'-';

Return $ systemInfo;
}



Response/*** obtain system information ** @ return array */function getSystemInfo () {$ systemInfo = array (); // System $ systemInfo [OS] = PHP_ OS; // PHP version $ systemIn...

Related Article

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.