Bug #74129 [NEW]: Incorrect SCRIPT_NAME with apache ProxyPassMatch when spaces are in path.
| From: | christian at groschupp dot org | Date: | Sun, 19 Feb 2017 17:10:36 +0000 |
| Subject: | Bug #74129 [NEW]: Incorrect SCRIPT_NAME with apache ProxyPassMatch when spaces are in path. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-207445@lists.php.net to get a copy of this message | ||
From: christian at groschupp dot org
Operating system: CentOS 7.3.1611
PHP version: 7.1.2
Package: FPM related
Bug Type: Bug
Bug description:Incorrect SCRIPT_NAME with apache ProxyPassMatch when spaces are in path.
Description:
------------
php version: 7.1.2
apache version: 2.4.6
apache configuration:
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/html/$1
Working apache configuration
<FilesMatch "\.php$">
SetHandler "proxy:fcgi://localhost:9000"
</FilesMatch>
I need the ProxyPassMatch variant, because i have also a apache 2.2 and
php 5.6 setup, where i can't use SetHandler.
Test script:
---------------
# Script to reproduce on CentOS 7
yum install -y epel-release
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install -y httpd php71-php-fpm
cat << EOF > /var/www/html/index.php
<?php
echo 'Value: ' . \$_SERVER['SCRIPT_NAME'] . '<br>';
echo 'Expected Value: ' . '/index.php'
?>
EOF
scl enable php71 php-fpm
echo "ProxyPassMatch ^/(.*\.php(/.*)?)$
fcgi://127.0.0.1:9000/var/www/html/$1" >>
/etc/httpd/conf.d/welcome.conf
apachectl -D FOREGROUND
Expected result:
----------------
When requesting "/index.php/1 2 3"
$_SERVER["SCRIPT_NAME"]: "/index.php"
Actual result:
--------------
$_SERVER["SCRIPT_NAME"]: "/index.php/1 2 3"
--
Edit bug report at https://bugs.php.net/bug.php?id=74129&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74129&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74129&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74129&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74129&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74129&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74129&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74129&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74129&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74129&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74129&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74129&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74129&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74129&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74129&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74129&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74129&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74129&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74129&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74129&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74129&r=mysqlcfg