PHP-FPM incorrectly defines the SCRIPT_NAME variable when using Apache
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php |
Unknown
|
Unknown
|
|||
php5 (CentOS) |
Confirmed
|
Medium
|
|||
php5 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Trusty |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Ubuntu 14.04.3 LTS
php5-fpm 5.5.9+dfsg-
this bug is fixed in php 5.5.18 <https:/
https:/
https:/
Description:
------------
When using Apache + PHP_FPM, the SCRIPT_NAME variable is incorrectly set. For
example, accessing "http://
ORIG_SCRIPT_NAME:
SCRIPT_NAME: /sample/
ORIG_SCRIPT_
SCRIPT_FILENAME: //tmp/sample/
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/
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_
echo('<br/>');
echo("SCRIPT_NAME: " . $_SERVER[
echo('<br/>');
echo("ORIG_
echo('<br/>');
echo("SCRIPT_
echo('<br/>');
echo("PATH_INFO: " . $_SERVER[
echo('<br/>');
echo("ORIG_
echo('<br/>');
?>
And a very simple apache conf:
Alias /sample /tmp/sample
ProxyPassMatch .*/sample/
<Directory /tmp/sample/ >
Require all granted
</Directory>
Expected result:
----------------
ORIG_SCRIPT_NAME:
SCRIPT_NAME: /sample/test.php
ORIG_SCRIPT_
SCRIPT_FILENAME: //tmp/sample/
PATH_INFO: /a/b/c
ORIG_PATH_INFO:
Changed in php5 (CentOS): | |
importance: | Unknown → Medium |
status: | Unknown → Confirmed |
Description of problem:
When using Apache + PHP_FPM, the SCRIPT_NAME variable is incorrectly set. For 127.0.0. 1/sample/ test.php/ a/b/c", results in:
example, accessing "http://
ORIG_SCRIPT_NAME: test.php/ a/b/c FILENAME: //tmp/sample/ test.php/ a/b/c test.php
SCRIPT_NAME: /sample/
ORIG_SCRIPT_
SCRIPT_FILENAME: //tmp/sample/
PATH_INFO: /a/b/c
ORIG_PATH_INFO:
While when using mod_php, the values are:
SCRIPT_NAME: /sample/test.php test.php
SCRIPT_FILENAME: /tmp/sample/
PATH_INFO: /a/b/c
This is a PHP bug and is fixed in PHP 5.5.18: https:/ /bugs.php. net/bug. php?id= 65641 /github. com/owncloud/ core/issues/ 7719
Please backport the fix. The popular package owncloud cannot be used with apache + php-fpm because of this issue: https:/
Version-Release number of selected component (if applicable):
< PHP 5.5.18
How reproducible:
100%
Steps to Reproduce: 127.0.0. 1/sample/ test.php/ a/b/c" with apache 2.4 and php-fpm.
1. See example above: access "http://
Actual results: test.php/ a/b/c FILENAME: //tmp/sample/ test.php/ a/b/c test.php
ORIG_SCRIPT_NAME:
SCRIPT_NAME: /sample/
ORIG_SCRIPT_
SCRIPT_FILENAME: //tmp/sample/
PATH_INFO: /a/b/c
ORIG_PATH_INFO:
Expected results: test.php
SCRIPT_NAME: /sample/test.php
SCRIPT_FILENAME: /tmp/sample/
PATH_INFO: /a/b/c