Home  >  Article  >  Backend Development  >  How to get server-side information in PHP, php gets server-side_PHP tutorial

How to get server-side information in PHP, php gets server-side_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:12:44848browse

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.

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