Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Oct 2005
    Posts
    13

    Default mod_fcgid context changes

    ----------------------------------------
    Easyapache 4199
    2008-05-14 12:28:01 Fixes
    Fixed various typos and grammatical errors
    Prevent use of FCGIWrapper directive in htaccess files
    Make PHP built by makecpphp use the php.ini in
    /usr/local/cpanel/3rdparty/etc
    ----------------------------------------

    We actually use FCGIWrapper directive in .htaccess files.

    I've already removed patch & recompiled/reinstalled mod_fcgid.so manually, but it seems that this need to be done after every Apache update.

    Is it possible to make this fix optional (and is this forum a right place to ask for something like this)?

  2. #2
    cPanel Staff
    Join Date
    Mar 2007
    Posts
    113

    Default

    When FCGIWrapper is used in a .htaccess file each request causes a new FastCGI server process to be created because the share_grp_id is incremented each time the .htaccess file is processed. This means the context of the current FCGIWrapper will never match the existing FCGIWrapper processes from mod_fcgid's perspective. The problem is detailed here:

    http://sourceforge.net/tracker/index...79&atid=870991

    Are PHP FastCGI processes filling up your machine after your revert that patch or are you doing something else to prevent that from happening? (Like setting the minimum process count to 0 and letting them timeout..)

  3. #3
    Member
    Join Date
    Oct 2005
    Posts
    13

    Default

    I was not aware of this problem, but we never get any serious performance hit or get OOM while using it.

    We use FCGIWrapper in .htaccess to specify custom php binaries on per-domain basis, for users that have multiple domains, and few of them still require php 4, while others running on php 5. It seems like easiest way to do so without manually editing httpd.conf. Well, seems like that should use per-domain includes instead until mod_fcgid developers fix this.

    Thanks.

    And one more question. To easy provide user-specific PHP binaries & ini files I've replaced /usr/local/cpanel/cgi-sys/php5 with this script:
    --------------------------
    #!/bin/bash

    if [ -e ~/php-fcgi/php ]; then
    if [ -e ~/php-fcgi/php.ini ]; then exec ~/php-fcgi/php -c ~/php-fcgi/php.ini
    else exec ~/php-fcgi/php
    fi
    elif [ -e ~/php-fcgi/php.ini ]; then exec /usr/local/cpanel/cgi-sys/php -c ~/php-fcgi/php.ini
    else exec /usr/local/cpanel/cgi-sys/php
    fi
    --------------------------

    This setup is working and we have no problems with it so far, but maybe there is some kind of potential problem.

    Are there any problems with that? Does mod_fcgid handle this well?
    Last edited by fasdush; 06-06-2008 at 06:33 PM.

  4. #4
    cPanel Staff
    Join Date
    Mar 2007
    Posts
    113

    Default

    I wouldn't trust that the -c argument to PHP will get parsed every time. There are some circumstances where the CGI binary will disregard all of the comand line options passed to it. Use the PHPRC environmental variable instead to be safe.

    Other than that, you should be fine. Each FastCGI wrapper context includes the UID, so it should be safe to specify a php.ini based on the UID. You may find that if you update the php.ini file the change will not take effect until existing PHP FastCGI servers expire.

  5. #5
    Member
    Join Date
    Oct 2005
    Posts
    13

    Default

    Thank you.

Similar Threads & Tags
Similar threads

  1. Context-Sensitive Help Everywhere in WHM
    By cPanelDavidG in forum Feature Requests for cPanel/WHM
    Replies: 0
    Last Post: 01-22-2010, 11:32 AM
  2. Tomcat, need Resource element in Context
    By jerrek71 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-27-2009, 12:43 AM
  3. Out of Context Message. [moved]
    By Alpha24 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 08-17-2005, 03:57 AM
  4. mod_rewrite, in a cPanel context
    By curioususer in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-08-2005, 07:21 PM
  5. Tomcat restart after context changes
    By steele in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 11-10-2003, 07:04 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube