Some things compiled by wwwphpvimnet

WBOY
Release: 2016-07-29 08:53:28
Original
938 people have browsed it
nginx is a Proxy. It is only responsible for faithfully passing parameters to FastCGI Server through the fastcgi_param directive according to the user's configuration file. The question is how does FastCGI Server handle the parameters provided by nginx?
For example, visit the following URL:

http://www.a.com/foo.jpg/a.php/b.php/c.php

According to the configuration given above, nginx is passed to FastCGI The value of SCRIPT_FILENAME is:
/home/verdana/public_html/unsafe/foo.jpg/a.php/b.php/c.php

, which is $_SERVER['ORIG_SCRIPT_FILENAME'].

When cgi.fix_pathinfo = 1 in php.ini, PHP CGI uses / as the delimiter to check the following paths from back to front:
/home/verdana/public_html/unsafe/foo.jpg/a.php/b .php/c.php
/home/verdana/public_html/unsafe/foo.jpg/a.php/b.php
/home/verdana/public_html/unsafe/foo.jpg/a.php

/home /verdana/public_html/unsafe/foo.jpg

Until you find an existing file, PHP will execute this file as a cgi script and assign the path to the CGI environment variable - SCRIPT_FILENAME, which is $_SERVER['SCRIPT_FILENAME '] is worth it.

This problem will also occur in many hosts using php-fpm (<0.6), but the new php-fpm has turned off cgi.fix_pathinfo. If you check the phpinfo() page, you will find that this option has been disabled. It no longer exists, and the return value of the code ini_get("cgi.fix_pathinfo") is also "false".

The above introduces some things compiled by wwwphpvimnet, including wph and php content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!