PHP native method to get server details

Source: Internet
Author: User

Get system type and version number: Php_uname () (Example: Windows NT PCA15130 6.1 build 7601 (Windows 7 Ultimate Edition Service Pack 1) i586)

Get system type only: Php_uname (' s ') (or: Php_os, example: Windows NT)

Get System version number only: Php_uname (' R ')

Get PHP Run as: Php_sapi_name () (PHP run Mode:apache2handler)

Get pre-process user name: Get_current_user ()

Get PHP version: Php_version

Get Zend Version: Zend_version ()

Get PHP Installation path: Default_include_path

Get the current file absolute path: __file__

Get the HOST value in the HTTP request: $_server[' Http_host '] (return value is domain name or IP)

Get Server Ip:gethostbyname ($_server[' server_name ')

Server IP receiving Request: $_server[' server_addr ' (sometimes not available, recommended by: gethostbyname ($_server[' server_name '))

Get client IP: $_server[' REMOTE_ADDR ']

Get server Interpreter Engine: $_server[' Server_software ']

Get the number of server CPUs: $_server[' Processor_identifier ']

Get Server System directory: $_server[' SystemRoot ']

Get the server domain name: $_server[' server_name ' (Recommended: $_server[' Http_host ')

Get user domain name: $_server[' UserDomain ']

Get server language: $_server[' HTTP_ACCEPT_LANGUAG ']

Get Server Web port: $_server[' Server_port ']

PHP native method to get server details

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.