php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54955 FastCGI doesn't recognize Windows relative paths
Submitted: 2011-05-30 22:08 UTC Modified: 2022-08-21 04:22 UTC
Votes:6
Avg. Score:4.5 ± 0.8
Reproduced:6 of 6 (100.0%)
Same Version:1 (16.7%)
Same OS:4 (66.7%)
From: johanntrg at msn dot com Assigned: cmb (profile)
Status: No Feedback Package: CGI/CLI related
PHP Version: 5.3.6 OS: Windows 7 64bits SP1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: johanntrg at msn dot com
New email:
PHP Version: OS:

 

 [2011-05-30 22:08 UTC] johanntrg at msn dot com
Description:
------------
I have configured my webserver (nginx) to have its document root out of its 
working path in "..\files" (please, note the two dots). When I request static 
files, it serves them without any problem. Anyway If I request a PHP file, the 
request it's not served because php-cgi.exe running as the fastCGI server al 
127.0.0.1:9000 returns an error 400 code.

If I user absolute paths it works. Also, if I move the "..\files" folder to 
"./files" (please, note the only one dot) and I change the document root to 
reflect that new relative path.

So It looks that relative paths with two dots are not getting resolved by php-
cgi.exe as fastCGI server.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-04 09:14 UTC] marc dot fauser+php at gmail dot com
I have the same problem since months. I would even pay money to get this bug fixed. So far you can "solve" it by using mklink.

e.g.
mklink /J files ..\files
 [2021-08-27 14:44 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-08-27 14:44 UTC] cmb@php.net
To clarify: in nginx.conf you have

    root: ../files

and in php.ini you have set doc_root to the absolute path of that
root?  This works for me; either the issue has been fixed in the
meantime, or I'm missing something.  Please clarify.
 [2021-09-05 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2022-08-10 08:53 UTC] lvslinux at gmail dot com
The same bug still exists. PHP Version 8.1.8 and ngix webserver. 
If the root in the NGIX server is i.e. "root ../myserver/ ;" the resolved SCRIPT_FILE name will contain "..". This causes a " No input file specified" error even thou the file exists and the path is valid.
 [2022-08-10 10:33 UTC] cmb@php.net
-Status: No Feedback +Status: Feedback
 [2022-08-10 10:33 UTC] cmb@php.net
@lvslinux, did you set the PHP directive doc_root to an *absolute*
path?
 [2022-08-21 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC