PHP method to obtain server-side information, php to obtain server-side information
The example in this article describes how PHP obtains server-side information. Share it with everyone for your reference.
The specific implementation method is as follows:
Copy code The code is as follows:
/**
* Get 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'] = '';
}
// Safe 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 upload file size
$systemInfo['maxuploadfile'] = ini_get('upload_max_filesize');
// Maximum memory occupied by script running
$systemInfo['memorylimit'] = get_cfg_var("memory_limit") ? get_cfg_var("memory_limit") : '-';
return $systemInfo;
}
I hope this article will be helpful to everyone’s PHP programming design.
http://www.bkjia.com/PHPjc/919268.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/919268.htmlTechArticleHow PHP obtains server-side information, php obtains server-side information. This article describes the method of PHP obtaining server-side information. Share it with everyone for your reference. The specific implementation method is as follows:...