logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Make mod_proxy_fcgi work in windows without patch
Author
viruscamp



Joined: 18 May 2022
Posts: 1
Location: US,NY

PostPosted: Wed 18 May '22 17:01    Post subject: Make mod_proxy_fcgi work in windows without patch Reply with quote

I have found a valid conf for mod_proxy_fcgi in windows, which fix the problem in thread:
https://www.apachelounge.com/viewtopic.php?t=7873

Code:

LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
<Files ~ "\.(php|phtml)$">
    SetHandler "proxy:fcgi://127.0.0.1:9000//./"
    ProxyFCGIBackendType GENERIC
</Files>


Then it's better to use https://github.com/deemru/php-cgi-spawner to act as php-fpm, and use nssm to wrap it as a windows service
Code:

php-cgi-spawner.exe "c:/php54/php-cgi.exe -c c:/php54/php.ini" 9000 2+8


Code:

[proxy_fcgi:trace8] mod_proxy_fcgi.c(385) AH01062: sending env var 'SCRIPT_FILENAME' value '//./C:/httpd/www/test.php'


And there are two more methods which may less efficient
Code:

# use # end url and preappend a driver letter
SetHandler "proxy:fcgi://127.0.0.1:9000#"
ProxyFCGIBackendType GENERIC
ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "C:%{reqenv:SCRIPT_FILENAME}"


Code:

# use / end url and use regex to remove the first /
# from
SetHandler "proxy:fcgi://127.0.0.1:9000/"
ProxyFCGIBackendType GENERIC
ProxyFCGISetEnvIf "reqenv('SCRIPT_FILENAME') =~ m#^/?(.*)$#" SCRIPT_FILENAME "$1"
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Tue 07 Jun '22 12:10    Post subject: Reply with quote

Thank you for sharing
Back to top


Reply to topic   Topic: Make mod_proxy_fcgi work in windows without patch View previous topic :: View next topic
Post new topic   Forum Index -> Apache