PHP Get server-side information method, PHP get server-side _php tutorial

Source: Internet
Author: User

PHP Get server-side information method, PHP get server-side


The example in this paper describes how PHP obtains server-side information. Share to everyone for your reference.

The implementation method is as follows:

Copy CodeThe 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 ');

Registering Global variables
$systemInfo [' registerglobals '] = ini_get (' register_globals ');

Turn on magic references
$systemInfo [' magicquotes '] = (function_exists ("GET_MAGIC_QUOTES_GPC") && GET_MAGIC_QUOTES_GPC ());

Maximum upload file size
$systemInfo [' maxuploadfile '] = ini_get (' upload_max_filesize ');
Script run consumes maximum memory
$systemInfo [' memorylimit '] = Get_cfg_var ("Memory_limit")? Get_cfg_var ("Memory_limit"): '-';

return $systemInfo;
}

I hope this article is helpful to everyone's PHP programming.

http://www.bkjia.com/PHPjc/919268.html www.bkjia.com true http://www.bkjia.com/PHPjc/919268.html techarticle PHP gets server- side information, PHP gets the server-side example of this article describes how PHP gets server-side information. Share to everyone for your reference. The concrete implementation method is as follows: ...

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