PHP exchange group, PHP blog, PHP getting system information and server details, PHP getting system information and server details, PHP technical exchange, PHP technical blog, PHP obtains system information and server details
Obtain the system type and version: php_uname () (for example, Windows nt computer 5.1 build 2600). only obtain the system type: php_uname ('s') (or PHP_ OS, for example, Windows NT) only get the system version: php_uname ('r') (example: 5.1) get the PHP running mode: php_sapi_name () (PHP run mode: apache2handler) get the previous process username: Get_Current_User () get PHP version: PHP_VERSION get Zend version: Zend_Version () get PHP Installation Path: DEFAULT_INCLUDE_PATH get the absolute path of the current FILE: _ FILE __
Obtain the Host value in an Http request: $ _ SERVER ["HTTP_HOST"] (the returned value is a domain name or IP address)
Get server ip: GetHostByName ($ _ SERVER ['server _ name'])
IP address of the SERVER that receives the request: $ _ SERVER ["SERVER_ADDR"] (sometimes it cannot be obtained. recommended: GetHostByName ($ _ SERVER ['server _ name'])
Obtain the client IP address: $ _ SERVER ['remote _ ADDR ']
Obtain SERVER interpretation engine: $ _ SERVER ['server _ soft']
Obtain the number of SERVER CPUs: $ _ SERVER ['processor _ IDENTIFIER ']
Get the SERVER system directory: $ _ SERVER ['systemroot']
Get SERVER domain NAME: $ _ SERVER ['server _ name'] (recommended: $ _ SERVER ["HTTP_HOST"])
Get user domain name: $ _ SERVER ['userdomain ']
Obtain the SERVER language: $ _ SERVER ['http _ ACCEPT_LANGUAGE ']
Obtain the SERVER Web PORT: $ _ SERVER ['server _ port']