Press "Enter" to skip to content

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

Multi-process Applications in PHP CLI Mode

PHP is often a poor fit for a resident SHELL process. It has no dedicated GC routine, and no effective path to memory management. So if you use PHP as a resident SHELL, you'll often be unhappy when memory exhaustion aborts the process.
And if the incoming data is invalid while the SHELL doesn't check it, causing an abort, that will make you unhappy too.
So? What do we do?
Multiple processes....

Filed in English, PHP应用
with 0 Comment