Home Backend Development PHP Tutorial PHP鏈嶅姟鍣ㄥ彉閲?SERVER璇﹁В

PHP鏈嶅姟鍣ㄥ彉閲?SERVER璇﹁В

Jun 13, 2016 am 11:03 AM
apache http php server

PHP鏈嶅姟鍣ㄥ彉閲?_SERVER璇﹁В

鏈嶅姟鍣ㄥ彉閲?$_SERVER 璇﹁В锛?/p>

1銆?_SESSION['PHP_SELF'] -- 鑾峰彇褰撳墠姝e湪鎵ц鑴氭湰鐨勬枃浠跺悕

2銆?_SERVER['SERVER_PROTOCOL'] -- 璇锋眰椤甸潰鏃堕?氫俊鍗忚鐨勫悕绉板拰鐗堟湰銆備緥濡傦紝鈥淗TTP/1.0鈥濄??/p>

3銆?_SERVER['REQUEST_TIME'] -- 璇锋眰寮?濮嬫椂鐨勬椂闂存埑銆備粠 PHP 5.1.0 璧锋湁鏁堛??/p>

4銆?_SERVER['argv'] -- 浼犻?掔粰璇ヨ剼鏈殑鍙傛暟銆?/p>

5銆?_SERVER['SERVER_NAME'] -- 杩斿洖褰撳墠涓绘満鍚嶃??/p>

6銆?_SERVER['SERVER_SOFTWARE'] -- 鏈嶅姟鍣ㄦ爣璇嗙殑瀛椾覆锛屽湪鍝嶅簲璇锋眰鏃剁殑澶翠俊鎭腑缁欏嚭銆?/p>

7銆?_SERVER['REQUEST_METHOD'] -- 璁块棶椤甸潰鏃剁殑璇锋眰鏂规硶銆備緥濡傦細鈥淕ET鈥濄?佲?淗EAD鈥濓紝鈥淧OST鈥濓紝鈥淧UT鈥濄??/p>

8銆?_SERVER['QUERY_STRING'] -- 鏌ヨ锛坬uery锛夌殑瀛楃涓诧紙URL 涓涓?涓棶鍙?? 涔嬪悗鐨勫唴瀹癸級銆?/p>

9銆?_SERVER['DOCUMENT_ROOT'] -- 褰撳墠杩愯鑴氭湰鎵?鍦ㄧ殑鏂囨。鏍圭洰褰曘?傚湪鏈嶅姟鍣ㄩ厤缃枃浠朵腑瀹氫箟銆偮?/p>

10銆?_SERVER['HTTP_ACCEPT'] -- 褰撳墠璇锋眰鐨?Accept: 澶翠俊鎭殑鍐呭銆?/p>

11銆?_SERVER['HTTP_ACCEPT_CHARSET'] -- 褰撳墠璇锋眰鐨?Accept-Charset: 澶翠俊鎭殑鍐呭銆備緥濡傦細鈥渋so-8859-1,*,utf-8鈥濄??/p>

12銆?_SERVER['HTTP_ACCEPT_ENCODING'] -- 褰撳墠璇锋眰鐨?Accept-Encoding: 澶翠俊鎭殑鍐呭銆備緥濡傦細鈥済zip鈥濄??/p>

13銆?_SERVER['HTTP_ACCEPT_LANGUAGE'] -- 褰撳墠璇锋眰鐨?Accept-Language: 澶翠俊鎭殑鍐呭銆備緥濡傦細鈥渆n鈥濄??/p>

14銆?_SERVER['HTTP_CONNECTION'] -- 褰撳墠璇锋眰鐨?Connection: 澶翠俊鎭殑鍐呭銆備緥濡傦細鈥淜eep-Alive鈥濄??/p>

15銆?_SERVER['HTTP_HOST'] -- 褰撳墠璇锋眰鐨?Host: 澶翠俊鎭殑鍐呭銆?/p>

16銆?_SERVER['HTTP_REFERER'] -- 閾炬帴鍒板綋鍓嶉〉闈㈢殑鍓嶄竴椤甸潰鐨?URL 鍦板潃銆?/p>

17銆?_SERVER['HTTP_USER_AGENT'] -- 杩斿洖鐢ㄦ埛浣跨敤鐨勬祻瑙堝櫒淇℃伅銆備篃鍙互浣跨敤 get_browser() 寰楀埌姝や俊鎭??/p>

18銆?_SERVER['HTTPS'] -- 濡傛灉閫氳繃https璁块棶锛屽垯琚涓轰竴涓潪绌虹殑鍊硷紝鍚﹀垯杩斿洖off.

19銆?_SERVER['REMOTE_ADDR'] -- 姝e湪娴忚褰撳墠椤甸潰鐢ㄦ埛鐨?IP 鍦板潃銆?/p>

20銆?_SERVER['REMOTE_HOST'] -- 姝e湪娴忚褰撳墠椤甸潰鐢ㄦ埛鐨勪富鏈哄悕銆傚弽鍚戝煙鍚嶈В鏋愬熀浜庤鐢ㄦ埛鐨?REMOTE_ADDR銆?/p>

21銆?_SERVER['REMOTE_PORT'] -- 鐢ㄦ埛杩炴帴鍒版湇鍔″櫒鏃舵墍浣跨敤鐨勭鍙c??/p>

22銆?_SERVER['SCRIPT_FILENAME'] -- 褰撳墠鎵ц鑴氭湰鐨勭粷瀵硅矾寰勫悕銆?/p>

23銆?_SERVER['SERVER_ADMIN'] -- 璇ュ?兼寚鏄庝簡 Apache 鏈嶅姟鍣ㄩ厤缃枃浠朵腑鐨?SERVER_ADMIN 鍙傛暟銆傚鏋滆剼鏈繍琛屽湪涓?涓櫄鎷熶富鏈轰笂锛屽垯璇ュ?兼槸閭d釜铏氭嫙涓绘満鐨勫??/p>

24銆?_SERVER['SERVER_PORT'] -- 鏈嶅姟鍣ㄦ墍浣跨敤鐨勭鍙c?傞粯璁や负鈥?0鈥濄?傚鏋滀娇鐢?SSL 瀹夊叏杩炴帴锛屽垯杩欎釜鍊间负鐢ㄦ埛璁剧疆鐨?HTTP 绔彛銆?/p>

25銆?_SERVER['SERVER_SIGNATURE'] -- 鍖呭惈鏈嶅姟鍣ㄧ増鏈拰铏氭嫙涓绘満鍚嶇殑瀛楃涓层??/p>

26銆?_SERVER['PATH_TRANSLATED'] -- 褰撳墠鑴氭湰鎵?鍦ㄦ枃浠剁郴缁燂紙涓嶆槸鏂囨。鏍圭洰褰曪級鐨勫熀鏈矾寰勩?傝繖鏄湪鏈嶅姟鍣ㄨ繘琛岃櫄鎷熷埌鐪熷疄璺緞鐨勬槧鍍忓悗鐨勭粨鏋溿??Apache 2 鐢?鎴峰彲浠ヤ娇鐢?httpd.conf 涓殑 AcceptPathInfo On 鏉ュ畾涔?PATH_INFO銆?/p>

27銆?_SERVER['SCRIPT_NAME'] -- 鍖呭惈褰撳墠鑴氭湰鐨勮矾寰勩?傝繖鍦ㄩ〉闈㈤渶瑕佹寚鍚戣嚜宸辨椂闈炲父鏈夌敤銆俖_FILE__ 鍖呭惈褰撳墠鏂囦欢鐨勭粷瀵硅矾寰勫拰鏂囦欢鍚嶏紙渚嬪鍖呭惈鏂囦欢锛夈??/p>

28銆?_SERVER['REQUEST_URI'] -- 璁块棶姝ら〉闈㈡墍闇?鐨?URI銆備緥濡傦紝鈥?index.html鈥濄??/p>

29銆?_SERVER['PHP_AUTH_DIGEST'] -- 褰撲綔涓?Apache 妯″潡杩愯鏃讹紝杩涜 HTTP Digest 璁よ瘉鐨勮繃绋嬩腑锛屾鍙橀噺琚缃垚瀹㈡埛绔彂閫佺殑鈥淎uthorization鈥滺TTP 澶村唴瀹癸紙浠ヤ究浣滆繘涓?姝ョ殑璁よ瘉鎿嶄綔锛夈??/p>

30銆?_SERVER['PHP_AUTH_USER']-- 褰?PHP 杩愯鍦?Apache 鎴?IIS锛圥HP 5 鏄?ISAPI锛夋ā鍧楁柟寮忎笅锛屽苟涓旀鍦ㄤ娇鐢?HTTP 璁よ瘉鍔熻兘锛岃繖涓彉閲忎究鏄敤鎴疯緭鍏ョ殑鐢ㄦ埛鍚嶃??/p>

31銆?_SERVER['PHP_AUTH_PW'] -- 褰?PHP 杩愯鍦?Apache 鎴?IIS锛圥HP 5 鏄?ISAPI锛夋ā鍧楁柟寮忎笅锛屽苟涓旀鍦ㄤ娇鐢?HTTP 璁よ瘉鍔熻兘锛岃繖涓彉閲忎究鏄敤鎴疯緭鍏ョ殑瀵嗙爜銆?/p>

32銆?_SERVER['AUTH_TYPE']--褰?PHP 杩愯鍦?Apache 妯″潡鏂瑰紡涓嬶紝骞朵笖姝e湪浣跨敤 HTTP 璁よ瘉鍔熻兘锛岃繖涓彉閲忎究鏄璇佺殑绫诲瀷銆?/p>

鍘熸枃:http://hi.baidu.com/sungoogle/blog/item/015d19305180869ba8018e68.html

Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP's Current Status: A Look at Web Development Trends PHP's Current Status: A Look at Web Development Trends Apr 13, 2025 am 12:20 AM

PHP remains important in modern web development, especially in content management and e-commerce platforms. 1) PHP has a rich ecosystem and strong framework support, such as Laravel and Symfony. 2) Performance optimization can be achieved through OPcache and Nginx. 3) PHP8.0 introduces JIT compiler to improve performance. 4) Cloud-native applications are deployed through Docker and Kubernetes to improve flexibility and scalability.

How to set the cgi directory in apache How to set the cgi directory in apache Apr 13, 2025 pm 01:18 PM

To set up a CGI directory in Apache, you need to perform the following steps: Create a CGI directory such as "cgi-bin", and grant Apache write permissions. Add the "ScriptAlias" directive block in the Apache configuration file to map the CGI directory to the "/cgi-bin" URL. Restart Apache.

PHP: A Key Language for Web Development PHP: A Key Language for Web Development Apr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

How to start apache How to start apache Apr 13, 2025 pm 01:06 PM

The steps to start Apache are as follows: Install Apache (command: sudo apt-get install apache2 or download it from the official website) Start Apache (Linux: sudo systemctl start apache2; Windows: Right-click the "Apache2.4" service and select "Start") Check whether it has been started (Linux: sudo systemctl status apache2; Windows: Check the status of the "Apache2.4" service in the service manager) Enable boot automatically (optional, Linux: sudo systemctl

The Enduring Relevance of PHP: Is It Still Alive? The Enduring Relevance of PHP: Is It Still Alive? Apr 14, 2025 am 12:12 AM

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP vs. Other Languages: A Comparison PHP vs. Other Languages: A Comparison Apr 13, 2025 am 12:19 AM

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP vs. Python: Core Features and Functionality PHP vs. Python: Core Features and Functionality Apr 13, 2025 am 12:16 AM

PHP and Python each have their own advantages and are suitable for different scenarios. 1.PHP is suitable for web development and provides built-in web servers and rich function libraries. 2. Python is suitable for data science and machine learning, with concise syntax and a powerful standard library. When choosing, it should be decided based on project requirements.

See all articles