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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

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.

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's Purpose: Building Dynamic Websites PHP's Purpose: Building Dynamic Websites Apr 15, 2025 am 12:18 AM

PHP is used to build dynamic websites, and its core functions include: 1. Generate dynamic content and generate web pages in real time by connecting with the database; 2. Process user interaction and form submissions, verify inputs and respond to operations; 3. Manage sessions and user authentication to provide a personalized experience; 4. Optimize performance and follow best practices to improve website efficiency and security.

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.

What to do if the apache80 port is occupied What to do if the apache80 port is occupied Apr 13, 2025 pm 01:24 PM

When the Apache 80 port is occupied, the solution is as follows: find out the process that occupies the port and close it. Check the firewall settings to make sure Apache is not blocked. If the above method does not work, please reconfigure Apache to use a different port. Restart the Apache service.

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

How to connect to the database of apache How to connect to the database of apache Apr 13, 2025 pm 01:03 PM

Apache connects to a database requires the following steps: Install the database driver. Configure the web.xml file to create a connection pool. Create a JDBC data source and specify the connection settings. Use the JDBC API to access the database from Java code, including getting connections, creating statements, binding parameters, executing queries or updates, and processing results.

See all articles