Public bug reported:

Ubuntu 14.04.3 LTS
php5-fpm 5.5.9+dfsg-1ubuntu4.14

this bug is fixed in php 5.5.18
<https://secure.php.net/ChangeLog-5.php#5.5.18>

https://bugs.php.net/bug.php?id=65641
https://bugzilla.redhat.com/show_bug.cgi?id=1248077

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:

** Affects: php
     Importance: Unknown
         Status: Unknown

** Affects: php5 (Ubuntu)
     Importance: Undecided
         Status: New

** Bug watch added: bugs.php.net/ #65641
   http://bugs.php.net/bug.php?id=65641

** Also affects: php via
   http://bugs.php.net/bug.php?id=65641
   Importance: Unknown
       Status: Unknown

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to php5 in Ubuntu.
https://bugs.launchpad.net/bugs/1511414

Title:
  PHP-FPM incorrectly defines the SCRIPT_NAME variable when using Apache

To manage notifications about this bug go to:
https://bugs.launchpad.net/php/+bug/1511414/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to