php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62381 FastCGI doesn't handle Apache script_filename on Windows
Submitted: 2012-06-21 09:55 UTC Modified: 2017-11-22 15:30 UTC
Votes:4
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:3 (75.0%)
From: dave at yougeezer dot co dot uk Assigned: ab (profile)
Status: Closed Package: CGI/CLI related
PHP Version: 5.4.4 OS: Windows XP
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dave at yougeezer dot co dot uk
New email:
PHP Version: OS:

 

 [2012-06-21 09:55 UTC] dave at yougeezer dot co dot uk
Description:
------------
When running PHP using the FPM support, it doesn't appear to process the 
script_filename environmental variable passed by Apache (using mod_proxy_fcgi).  
This is probably related to #54152

Running a tool that monitors file access the following path is checked:

C:\php54\proxy:fcgi:\127.0.0.1:9054\c:\Apache24\htdocs\

Don't fully understand how PHP handles this but tried setting 
APACHE_PROXY_FCGI_PREFIX to various different values by using:
SetEnv APACHE_PROXY_FCGI_PREFIX "proxy:fcgi:\\"
...in the Apache configuration file.  But it didn't appear to have any effect.

Test script:
---------------
Apache conf:
ProxyPass / fcgi://127.0.0.1:9054/c:/Apache24/htdocs/php54

PHP startup:
c:\php54\php-cgi.exe -b 127.0.0.1:9054 -c c:\php54\php.ini

Expected result:
----------------
c:\Apache24\htdocs\

Actual result:
--------------
C:\php54\proxy:fcgi:\127.0.0.1:9054\c:\Apache24\htdocs\

Patches

FPM-Fix-Windows-drive-letters (last revision 2012-09-10 08:38 UTC by tulach at position dot cz)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-21 12:41 UTC] pajoye@php.net
-Package: FPM related +Package: CGI/CLI related
 [2012-06-21 12:41 UTC] pajoye@php.net
There is no FPM on windows.
 [2012-06-21 12:56 UTC] dave at yougeezer dot co dot uk
There seems to be, I have FPM working fine with the nginx Windows port and PHP 
5.4.4.

Here's an example of the config I used for nginx:
location ~ \.php$ {
  root           html;
  fastcgi_pass   127.0.0.1:9054;
  fastcgi_index  index.php;
  fastcgi_param  SCRIPT_FILENAME  c:/nginx-1.2.1/html/$fastcgi_script_name;
  include        fastcgi_params;
}

Plus the "-b IP:Port" argument is there... but I didn't see any new php-cgi 
processes created to handle requests.
 [2012-06-27 10:10 UTC] ab@php.net
You use c:\php54\php-cgi.exe which runs clearly in FastCGI mode. No FPM is going under Win as it uses libevent (saw some people playing with cygwin, but that's tricky stuff anyway). This looks more like a configuration issue in your apache after all.
 [2012-06-27 10:26 UTC] dave at yougeezer dot co dot uk
Ah, thanks for clearing that up.  That explains the fact that there aren't any 
extra php processes being launched.  Doesn't explain the issue with no input file 
being specified as I'd have though #54152 would have fixed the path issue of 
Apache not passing SCRIPT_FILENAME correctly.

Shame about libevent holding FPM back on Windows, maybe the work being done with 
libuv could be of use?
 [2012-06-28 18:34 UTC] ab@php.net
btw I see you're using apache 2.4, do you have the same error with apache 2.2?
 [2012-06-29 07:49 UTC] dave at yougeezer dot co dot uk
Can't reproduce the same set up on Apache 2.2 as mod_proxy_fcgi only came with 
2.3+.  Should we close this issue then, since FPM isn't currently available for 
Windows?  Or are you still thinking it's a probably with the FastCGI code that 
handles Apache's wrongness?

I think I'll put in a feature request for FPM on Windows.
 [2012-12-12 21:26 UTC] tulach at position dot cz
Patch exists and three months later the bug is still open :(.
 [2012-12-13 00:11 UTC] aharvey@php.net
-Summary: FPM doesn't handle Apache script_filename on Windows +Summary: FastCGI doesn't handle Apache script_filename on Windows
 [2017-11-22 15:30 UTC] ab@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2017-11-22 15:30 UTC] ab@php.net
FPM doesn't exist on windows.

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 03:01:27 2024 UTC