|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64689 _SERVER["SCRIPT_NAME"] incorrectly evaluated
Submitted: 2013-04-22 08:40 UTC Modified: 2013-04-22 09:09 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: admin at 3dr dot org Assigned:
Status: Not a bug Package: FPM related
PHP Version: 5.3Git-2013-04-22 (Git) OS: FreeBSD 9.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
40 + 25 = ?
Subscribe to this entry?

 [2013-04-22 08:40 UTC] admin at 3dr dot org
I use mod_proxy_fcgi along with FPM:

ProxyPassMatch ^/(.*\.php(/.*)?)$ 
l/$1 timeout=180

Using scripts like this:

causes _SERVER["SCRIPT_NAME"] to be wrongly evaluated. Instead of 
/glowna/index.php FPM returns 
/glowna/index.php/aaa/bbb/ccc which obviously also destroys _SERVER["PHP_SELF"].

We've checked it with cgi.fix_pathinfo = 0 (no input file specified error) and 
cgi.fix_pathinfo = 1.
proxy-fcgi-pathinfo = 1 doesn't help to.

Expected result:
_SERVER["REQUEST_URI"]	/glowna/index.php/aaa/bbb/ccc
_SERVER["SCRIPT_NAME"]	/glowna/index.php
_SERVER["PATH_INFO"]	/aaa/bbb/ccc
_SERVER["PHP_SELF"]	/glowna/index.php/aaa/bbb/ccc

Actual result:
_SERVER["REQUEST_URI"]	/glowna/index.php/aaa/bbb/ccc
_SERVER["SCRIPT_NAME"]	/glowna/index.php/aaa/bbb/ccc
_SERVER["PATH_INFO"]	/aaa/bbb/ccc
_SERVER["PHP_SELF"]	/glowna/index.php/aaa/bbb/ccc/aaa/bbb/ccc


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-22 08:55 UTC]
-Status: Open +Status: Not a bug
 [2013-04-22 08:55 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

$_SERVER variables are passed by the server, PHP doesn't touch it.
 [2013-04-22 09:09 UTC] admin at 3dr dot org
Well - this is not true - FPM is evaluating most of _SERVER variables. Just have 
look at fpm_main.c at line 1198 - that's the place where SCRIPT_NAME is beeing 
When you try to send [E=SCRIPT_NAME:whatever] from Apache side - it's beeing 
immidiatelly overwritten by FPM. 
Go check by yourself.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Jan 19 19:03:14 2022 UTC