logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 


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

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.




FastCGI headache

 
Post new topic   Reply to topic    Apache Forum Index -> Apache third-party Modules



View previous topic :: View next topic  
Author Message
phil1234



Joined: 24 Jul 2015
Posts: 11

PostPosted: Tue 22 Sep '15 16:46    Post subject: FastCGI headache Reply with quote

Hello everyone,

I compiled/installed 3 versions of php on a apache 2 server (debian 7)

I followed like 10 tutorials about FastCGI/PHP-FPM, and I barely have a phpinfo page working (with the wrong version of php)

I feel like my nose is about to bleed

I defined a virtual host that should deal with php requests and lead them to use a fastcgi php v5.2.4
and it returns php 5.3.10 instead

Code:

<VirtualHost *:80>
   ServerName localhost
   
   DocumentRoot /var/www

   FastCGIExternalServer /var/www/cgi-bin/php-5.2.4.fcgi -host 127.0.0.1:9000

   <Directory /var/www>

      Order allow,deny
      Allow from all
      
      AddType application/x-httpd-fastphp5 .php
      Action application/x-httpd-fastphp5 /cgi-bin/php-5.2.4.fcgi
   </Directory>
</VirtualHost>



php-5.2.4.fcgi

Code:

#!/bin/sh
PHP_FCGI_CHILDREN=5
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=1000
export PHP_FCGI_MAX_REQUESTS
exec /opt/php-5.2.4/bin/php-cgi

can someone help me out ?

thanks
Back to top
James Blond
Moderator


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

PostPosted: Wed 07 Oct '15 13:48    Post subject: Reply with quote

A working config is

Code:

#global settings
<IfModule fcgid_module>
   FcgidConnectTimeout 10
   FcgidMaxProcesses 300
   FcgidMaxProcessesPerClass 300
   FcgidOutputBufferSize 64
   ProcessLifeTime 0
   FcgidMaxRequestsPerProcess 0
   FcgidMinProcessesPerClass 0
   FcgidFixPathinfo 0
   FcgidProcessLifeTime 0
   FcgidZombieScanInterval 20
   FcgidMaxRequestLen 536870912
   FcgidIOTimeout 120
   FcgidTimeScore 3
</IfModule>

#example vhost
<VirtualHost *:80>
    ServerAdmin info@example.com
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /opt/apache2/htdocs
    FileETag MTime Size
    <Directory /opt/apache2/htdocs/>
        Options Indexes FollowSymLinks Multiviews ExecCGI
        AllowOverride None
        <RequireAll>
        Require all granted
        </RequireAll>
        AddHandler fcgid-script .php
        FCGIWrapper /usr/bin/php5-cgi .php
    </Directory>
    ErrorLog /opt/apache2/logs/error.log
    LogLevel warn

    CustomLog /opt/apache2/logs/access.log combined

</VirtualHost>


You can adjust the path for FCGIWrapper
So each vhost and or directory can have each own php version.

Any other question on that?
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Apache third-party Modules
Page 1 of 1