The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FastCGI timeout issue

Discussion in 'General Discussion' started by McPhil, Mar 10, 2009.

  1. McPhil

    McPhil Active Member

    Joined:
    Sep 20, 2007
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Hi all - we have set up (finally) our CentOS 5.2.x server with WHM/Cpanel 11 running Apache and FastCGI. Server and website runs great except for a periodic error:

    [Tue Mar 10 15:57:50 2009] [notice] mod_fcgid: process /home/uberuser/public_html/index.php(20420) exit(lifetime expired), terminated by calling exit(), return code: 0
    [Tue Mar 10 13:01:13 2009] [notice] mod_fcgid: call /home/uberuser/public_html/test/index.php with wrapper /usr/local/cpanel/cgi-sys/php5

    After sometime researching the error on the internets (all of them :P) I found this page:

    http://spire-solutions.com/blogs/jeffw/modfcgid-and-timeouts

    This describes the exact error we're having but I can't find the mod_fcgi file to edit with the cpanel installation as it seems the default mod_fcgi file is moved on CentOS 5.2.x with cPanel installed.

    Does anyone know where the FastCGI file is on CentOS with cPanel/WHM 11 installed?
     
  2. McPhil

    McPhil Active Member

    Joined:
    Sep 20, 2007
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Update - I've tried editing the timeout settings in the php.ini file with no luck in removing the error listed in the above post. Does anyone have any clue to help me narrow what file(s) to edit?
     
  3. InterServed

    InterServed Well-Known Member

    Joined:
    Jul 10, 2007
    Messages:
    255
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    DataCenter Provider
    /usr/local/apache/conf/php.conf
     
  4. McPhil

    McPhil Active Member

    Joined:
    Sep 20, 2007
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    ok, cool. So open the file to take a peak I get this:

    # This file was automatically generated by the Cpanel PHP Configuration system
    # If you wish to change the way PHP is being handled by Apache on your system,
    # use the /usr/local/cpanel/bin/rebuild_phpconf script or the WHM interface.
    #
    # Manual edits of this file will be lost when Apache is updated.


    # Fastcgi configuration for PHP5
    LoadModule fcgid_module modules/mod_fcgid.so
    MaxRequestsPerProcess 500
    AddHandler fcgid-script .php5 .php4 .php .php3 .php2 .phtml
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php5
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php4
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php3
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php2
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .phtml

    # End of autogenerated PHP configuration.

    Looking into it more, I run pstree -p in a shell and I get:

    ââhttpd(11558)ââ¬âhttpd(10000)
    â ââhttpd(11265)
    â ââhttpd(11547)
    â ââhttpd(16380)
    â ââhttpd(18406)
    â ââhttpd(19610)
    â ââhttpd(25993)
    â ââhttpd(26099)
    â ââhttpd(28304)âââphp5(31827)
    â ââhttpd(28343)
    â ââhttpd(29970)


    So now, I can see the PID for the hung php5 process and that it's a child of httpd PID 28304.

    I look for the hung PID that is associated with the error. the /usr/local/cpanel/cgi-sys/php5 is giving the timeout issues (which makes sense because we are using php5). Error is found here like this:

    Time: Thu Mar 19 16:00:21 2009 +0000
    Account: uberuser
    Resource: Process Time
    Exceeded: 28423 > 1800 (seconds)
    Executable: /usr/local/cpanel/cgi-sys/php5
    Command Line: php5
    PID: 31827
    Killed: No

    When I go to look in the /usr/local/cpanel/cgi-sys/php5 file, it's encrypted...

    Without knowing what I'm doing (like always...) I assume the default setting is 1800 seconds (where ever the setting to edit may be...). Would anyone take the time to discuss why php5 is trying to run for such a long time with FastCGI? If I changed the setting to accommodate the time for whatever script is requiring this amount of time, I fear that would cause a security hole. Am I right to think this?

    Thanks for your post mate. I'm really just trying to learn as much as I can and I appreciate everyone's comments. Hopefully other people can learn from my drivel too.
     
  5. ronzpt

    ronzpt Registered

    Joined:
    Sep 11, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    Im having the exact problem .. as McPhil .. and also my host pointed me to /usr/local/apache/conf/php.conf and had the same entries ... no idea what to do .. please help
     
  6. InterServed

    InterServed Well-Known Member

    Joined:
    Jul 10, 2007
    Messages:
    255
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    DataCenter Provider
    Code:
    # This file was automatically generated by the Cpanel PHP Configuration system
    # If you wish to change the way PHP is being handled by Apache on your system,
    # use the /usr/local/cpanel/bin/rebuild_phpconf script or the WHM interface.
    #
    # Manual edits of this file will be lost when Apache is updated.
    
    
    # Fastcgi configuration for PHP5
    LoadModule fcgid_module modules/mod_fcgid.so
    MaxRequestsPerProcess 500
    [COLOR="Red"]ProcessLifeTime 7200
    IPCConnectTimeout 30
    IPCCommTimeout 60[/COLOR]
    AddHandler fcgid-script .php5 .php4 .php .php3 .php2 .phtml
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php5
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php4
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php3
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php2
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .phtml
    
    # End of autogenerated PHP configuration.
    Consider adding the highlighted options in red to /usr/local/apache/conf/php.conf as i described above.
     
Loading...

Share This Page