Press "Enter" to skip to content

PHP Internals — The Lifetime of a Variable (Part 1)

PHP variables come from two places: the code itself and the outside world (GET/POST/DB), and their lifetimes differ. This article traces the whole lifecycle of GET data, from php_request_startup and php_hash_environment through php_default_treat_data, php_strtok_r and php_register_variable_safe, showing how a query string is turned into the $_GET array.

Filed in English, PHP源码分析
with 0 Comment

The PATH_INFO Problem with Nginx (PHP/fastcgi)

PATH_INFO is a CGI 1.1 standard, and it is often used as a carrier for passing parameters.
In Apache, with no configuration at all, AcceptPathInfo is accepted by default for PHP scripts, which means:
if the server has a /laruence/info.php
then for the following requests, Apache accepts them all:

/laruence/info.php/dummy
/laruence/info.php/pathinfo

Under Nginx, by default Nginx does not support PATH INFO, meaning those requests will 404 with a file-not-found error.

Filed in English, Linux/Unix, PHP应用
with 0 Comment