|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67998 Wrong SCRIPT_FILENAME
Submitted: 2014-09-10 14:15 UTC Modified: -
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: php-fpm1 at gmail dot com Assigned:
Status: Open Package: FPM related
PHP Version: 5.4.32 OS: CentOS6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: php-fpm1 at gmail dot com
New email:
PHP Version: OS:


 [2014-09-10 14:15 UTC] php-fpm1 at gmail dot com
Wrong SCIPRT_FILENAME is given. It contains '/' twice at the start of it (//).

["SCRIPT_FILENAME"]=> string(57) "//home/admin/domains/testing.domain.tld/public_html/test.php" 

Other variables are okay:
["CONTEXT_DOCUMENT_ROOT"]=> string(47) "/home/admin/domains/testing.domain.tld/public_html"
["DOCUMENT_ROOT"]=> string(47) "/home/admin/domains/testing.domain.tld/public_html"
["REQUEST_URI"]=> string(9) "/test.php" 
["SCRIPT_NAME"]=> string(9) "/test.php" 
["PHP_SELF"]=> string(9) "/test.php" 
["HOME"]=> string(11) "/home/admin"

It also breaks SG(request_info).path_translated in extensions.

Test script:
echo $_SERVER;

Expected result:
["SCRIPT_FILENAME"]=> string(57) "/home/admin/domains/testing.domain.tld/public_html/test.php" 

Actual result:
["SCRIPT_FILENAME"]=> string(57) "//home/admin/domains/testing.domain.tld/public_html/test.php" 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-09-10 14:22 UTC] phpfpm1 at gmail dot com
I forgot to mention that the bug affects PHP 5.4.33RC1 too, so doesn't fix it.
 [2014-09-10 15:50 UTC] phpfpm1 at gmail dot com
BTW, PHP-FPM is setup using unix domain sockets in Apache.

AddHandler "proxy:unix:/usr/local/php54/sockets/admin.sock|fcgi://localhost/" .inc .php .phtml .php54

More info:

I've found that the following fixes the problem (removing "/" from the end of "localhost"):
AddHandler "proxy:unix:/usr/local/php54/sockets/admin.sock|fcgi://localhost" .inc .php .phtml .php54

But official Apache documentation states that "/" ending should be there.
 [2014-09-11 05:33 UTC] dz at heroku dot com
The docs are wrong. Don't add a trailing slash. The request URI is appended to whatever you provide in SetHandler.

The use of UDS may also further confuse things as PHP doesn't handle that.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Mar 30 09:05:50 2023 UTC