From:             ryotakatsuki at gmail dot com
Operating system: 
PHP version:      5.5.3
Package:          FPM related
Bug Type:         Bug
Bug description:PHP-FPM incorrectly defines the SCRIPT_NAME variable when using 
Apache

Description:
------------
When using Apache + PHP_FPM, the SCRIPT_NAME variable is incorrectly set.
For 
example, accessing "http://127.0.0.1/sample/test.php/a/b/c";, results in:

ORIG_SCRIPT_NAME: 
SCRIPT_NAME: /sample/test.php/a/b/c
ORIG_SCRIPT_FILENAME: //tmp/sample/test.php/a/b/c
SCRIPT_FILENAME: //tmp/sample/test.php
PATH_INFO: /a/b/c
ORIG_PATH_INFO: 

While when using mod_php, the values are:

SCRIPT_NAME: /sample/test.php
SCRIPT_FILENAME: /tmp/sample/test.php
PATH_INFO: /a/b/c

It is also working fine when using NGINX

Test script:
---------------
A sameple script to reproduce the issue:

<?php
echo("ORIG_SCRIPT_NAME: " . $_SERVER['ORIG_SCRIPT_NAME']);
echo('<br/>');

echo("SCRIPT_NAME: " . $_SERVER['SCRIPT_NAME']);
echo('<br/>');
echo("ORIG_SCRIPT_FILENAME: " . $_SERVER['ORIG_SCRIPT_FILENAME']);
echo('<br/>');

echo("SCRIPT_FILENAME: " . $_SERVER['SCRIPT_FILENAME']);
echo('<br/>');

echo("PATH_INFO: " . $_SERVER['PATH_INFO']);
echo('<br/>');

echo("ORIG_PATH_INFO: " . $_SERVER['ORIG_PATH_INFO']);
echo('<br/>');

?>

And a very simple apache conf:

Alias /sample /tmp/sample
ProxyPassMatch .*/sample/(test.php.*) fcgi://127.0.0.1:9000//tmp/sample/$1
<Directory /tmp/sample/ >
    Require  all granted
</Directory>


Expected result:
----------------
ORIG_SCRIPT_NAME: 
SCRIPT_NAME: /sample/test.php
ORIG_SCRIPT_FILENAME: //tmp/sample/test.php/a/b/c
SCRIPT_FILENAME: //tmp/sample/test.php
PATH_INFO: /a/b/c
ORIG_PATH_INFO: 


-- 
Edit bug report at https://bugs.php.net/bug.php?id=65641&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=65641&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=65641&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=65641&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=65641&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=65641&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=65641&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=65641&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=65641&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=65641&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=65641&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=65641&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=65641&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=65641&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65641&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=65641&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=65641&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=65641&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65641&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=65641&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=65641&r=mysqlcfg

Reply via email to