Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    May 2006
    Posts
    42

    Default FastCGI with PHP and Apache

    I'm trying to get fastcgi to work with php and apache manually (I don't want to affect the PHP which runs under apache normally, instead I want to install another version), however I'm having trouble getting the configuration right in httpd.conf

    Amongst the most confusing things are the instructions here:
    PHP | FastCGI -

    What is supposed to be under /export? This directory does not even exist on my file system, and I've never heard of it before.

    Also, would anyone care to share their httpd.conf if they are using fastcgi in a multi-user environment?

    Cheers

  2. #2
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    FastCGI should only be used to load Perl based scripts on servers where PHP is running as a DSO (Apache module)
    or where PHP is running as a pure CGI / phpSuExec (Neither are recommended) without SuPHP.

    FastCGI SHOULD NOT should not be used if you are using SuPHP for your
    PHP installation on your server!

    The information on the FastCGI site is actually pretty old and doesn't take into account current PHP installations
    and most of what is written was actually written during the time between plain CGI mode and early phpSuExec
    was released which are both quite different from today's typical SuPHP installations which do not need FastCGI.

    In fact, running FastCGI along side SuPHP will actually SLOW down your server's performance as well as
    create a number of server compatibility and stability issues!

    If you are running PHP as an Apache module (DSO) then FastCGI won't have any effect on PHP and will just
    serve to help performance with Perl / CGI scripts running on your server.
    Last edited by Spiral; 08-02-2009 at 05:43 PM.

  3. #3
    Member
    Join Date
    May 2006
    Posts
    42

    Default

    Thanks for the tip!

    What would you recommend I use to run another version of PHP which does not interfere with the default php install which works as an apache module?

    Edit: I think you may have misunderstood my setup. I currently have PHP as an apache module, and I am not using suPHP. I am looking for a way to run another version of PHP alongside the version I am running as an apache module (and without affecting it), so as far as I understand, the only way to do this is to run it as a cgi module, and from what I heard, fastcgi is faster than cgi - which is why I chose it. But if you can suggest something better, feel free.

    Thanks!
    Last edited by Starcraftmazter; 08-02-2009 at 11:07 PM.

  4. #4
    cPanel Partner NOC cPanel Partner NOC Badge anton_latvia's Avatar
    Join Date
    May 2004
    Posts
    277

    Default

    Spiral - what about apache 2.2 module fastcgid ? As far as I understand from the docs, apache should spawn fastcgi daemons for each user that is running PHP sites and should keep them running/processing PHP files under user privileges. This does sound very similar as in suPHP mode, but should eliminate time used for executing binary php for every php request. Executing separate PHP process in suPHP (CGI) mode creates high IO load.. I would appreciate your comments.

    Anton.
    * http://www.aleksandrov.eu/ - just a simple personal homepage.

  5. #5
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Lightbulb

    Starcraftmazter, I am still a little baffled as to why you would want to run two versions of PHP? That part does not make any logical sense to me and introduces potential conflicts.

    Can you do that? Sure!

    Would I recommend it? No!

    Anton_Latvia, to answer your question .... No!

    It actually reduces overall system performance very slightly but measurable and doesn't give any acceleration to the execution of PHP scripts; This is primarily likely due to the fact that SuPHP is actually a DSO itself which in turn makes it's own internal calls to the PHP CGI Binary separate from the typical Apache CGI API structures in place as you would find for Perl scripts or phpSuExec.

  6. #6
    cPanel Partner NOC cPanel Partner NOC Badge anton_latvia's Avatar
    Join Date
    May 2004
    Posts
    277

    Default

    Spiral, sorry for reasking. What do you compare with when saying:

    It actually reduces overall system performance very slightly but measurable and doesn't give any acceleration to the execution of PHP scripts;
    If FastCGId can descrease I/O load, that would mean something too - right now 25% is used by IO (measured by munin). I will be testing fastcgi this night. What worries me is - what ownership and permissions will uploaded files have and if I still will be able to allow customers change from one PHP version to another.

    Sorry, I haven't heard any real reason why cPanel and you do not recommend fastcgid module.

    Anton.
    * http://www.aleksandrov.eu/ - just a simple personal homepage.

Similar Threads & Tags
Similar threads

  1. Replies: 10
    Last Post: 12-11-2010, 05:43 PM
  2. Replies: 26
    Last Post: 11-24-2010, 01:34 PM
  3. Apache on mode FastCGI
    By speckados in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-28-2008, 06:04 AM
  4. Setting up FastCGI on Apache
    By dennismv in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 09-24-2007, 09:41 AM
  5. PHP, SuExec, FastCGI and Apache 1.3.x
    By asterisk in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 09-02-2006, 11:10 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube