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