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 -> Other Software View previous topic :: View next topic
Reply to topic   Topic: PHP: mod_proxy_fcgi Vs. mod_fcgid
Author
daibach



Joined: 24 Apr 2007
Posts: 33
Location: Cardiff, Wales, UK

PostPosted: Thu 21 Jun '12 10:28    Post subject: PHP: mod_proxy_fcgi Vs. mod_fcgid Reply with quote

Hi,

I've been trying to get multiple versions of PHP working under Apache as the same time. It's needed to support an application that isn't compatible with PHP 5.4. But I've run into problems with mod_proxy_fcgi and mod_fcgid that are preventing me from getting it all working smoothly.

mod_fcgid

Code:

<VirtualHost *:80>
  DocumentRoot "c:/Apache24/htdocs/php53"
  ServerName php53.localhost
  FcgidInitialEnv PHPRC "c:/php53"
  FcgidInitialEnv PATH "c:/php53;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
  <Files ~ "\.php$>"
    AddHandler fcgid-script .php
    FcgidWrapper "c:/php53/php-cgi.exe" .php
  </Files>
</VirtualHost>

<VirtualHost *:80>
  DocumentRoot "c:/Apache24/htdocs/php54"
  ServerName php54.localhost
  FcgidInitialEnv PHPRC "c:/php53"
  FcgidInitialEnv PATH "c:/php53;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
  <Files ~ "\.php$>"
    AddHandler fcgid-script .php
    FcgidWrapper "c:/php53/php-cgi.exe" .php
  </Files>
</VirtualHost>


Although this works and I get the correct versions of PHP for each virtual host, every so often a request will take about 10 seconds to response. As if it's trying to talk to a php-cgi.exe process that's the wrong version, times out and then finds a process of the correct version. As if mod_fcgid doesn't properly handle groups of different processes (differentiated by version).

mod_proxy_fcgi

I'd really like to take this approach as it also enables running FastCGI PHP processes on other servers if needed.

Code:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
ProxyPass / fcgi://localhost:9123/


Code:
php-cgi.exe -b 127.0.0.1:9123 -c C:\php54\php.ini


PHP starts up fine, Apache is happy with the configuration but when I try and browse to a file I just get "No Input File Specified". I know you can add path information on the end of the fcgi URL but this doesn't seem to work, just get the same error.

Also, there's the issue of how to run the php-cgi process as a Windows service properly. Haven't been able to check if it'd properly shutdown spawned processes if ended.

Cheers!
Back to top
daibach



Joined: 24 Apr 2007
Posts: 33
Location: Cardiff, Wales, UK

PostPosted: Thu 21 Jun '12 12:00    Post subject: Reply with quote

To provide further information. When taking the mod_proxy_fcgi approach, it appears that Apache passed the URL to PHP as:

C:\php54\proxy:fcgi:\127.0.0.1:9054\

Apparently there was a bug reported and a fix:
https://bugs.php.net/bug.php?id=54152

But it's not working for me and might be the fact that something slightly different is being passed and not catered for in Windows.

I've submitted another bug report covering the Windows side of things since that bug only specified Linux.

https://bugs.php.net/bug.php?id=62381
Back to top


Reply to topic   Topic: PHP: mod_proxy_fcgi Vs. mod_fcgid View previous topic :: View next topic
Post new topic   Forum Index -> Other Software