ID: 34554 Updated by: [EMAIL PROTECTED] Reported By: jr-php2 at quo dot to -Status: Open +Status: Bogus Bug Type: CGI related Operating System: Linux PHP Version: 5.0.5 New Comment:
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. See bug #31892 Previous Comments: ------------------------------------------------------------------------ [2005-09-19 23:00:46] jr-php2 at quo dot to Description: ------------ Under PHP 5, when PHP is invoked from a CGI script (using Apache 2.0.54's standard mod_cgi mechanism), the PATH_INFO environment variable is always empty. I've found that this problem is related to the "cgi.fix_pathinfo" option. When this option is set to 1 -- the default in PHP 5.0.5 -- PATH_INFO is always empty. When this option is set to 0 -- the default in PHP 4.4.0 -- PATH_INFO is set correctly. This same(?) issue was reported in Bug #23800, but apparently the reporter was content with just setting cgi.fix_pathinfo=0 and closing the report. The actual problem with PATH_INFO being empty when cgi.fix_pathinfo=1 went unaddressed. I do not see any reason to believe this behavior is correct. The (rather vague) documentation for cgi.fix_pathinfo states: "...For more information on PATH_INFO, see the cgi specs. Setting this to 1 will cause PHP CGI to fix it's paths to conform to the spec." The CGI specs certainly don't say that PATH_INFO should be an empty string, so we aren't seeing increased conformance with the spec here. On the contrary, setting PATH_INFO to an empty string when there is path info introduces non-conformance with the spec. My PHP configure line: ./configure --prefix=/usr/local/php-cgi --enable-track-vars --with-mysql --with-zlib --with-openssl --enable-discard-path Reproduce code: --------------- Create a file named "test.cgi" with these four lines: #!/usr/local/php-cgi/bin/php <?php phpinfo(); ?> Give it execute permission (chmod +x), and place it in <document root>/cgi-bin. Then open the following URL: http://<hostname>/cgi-bin/test.cgi/extrapathinfo Expected result: ---------------- In the Environment table, I expect to see the following: PATH_INFO /extrapathinfo Actual result: -------------- PATH_INFO no value ORIG_PATH_INFO /extrapathinfo (PHP has copied the original PATH_INFO value to ORIG_PATH_INFO, and cleared PATH_INFO.) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34554&edit=1