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.

PHP5 + Apache using fcgi working, phpinfo problem

Discussion in 'Workarounds and Optimization' started by momon, Jun 22, 2010.

  1. momon

    momon Registered

    Joined:
    Jun 22, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hello, I am hoping someone could give me some pointers to troubleshoot this:

    I have PHP and Apache working with fastcgi. It's working pretty good so far but I have faced a couple of issues which I've been unable to figure out.

    When I have PHP running with Handler suphp (through the WHM interface) I can see my phpinfo(); script correctly working.

    When I have it as fcgi, my phpinfo(); script displays a 500 server error. Checking the apache error log for this error shows me this:

    Code:
    [Tue Jun 22 04:11:43 2010] [warn] [client 190.166.162.190] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
    [Tue Jun 22 04:11:43 2010] [warn] [client 190.166.162.190] (104)Connection reset by peer: mod_fcgid: ap_pass_brigade failed in handle_request function
    when I go back to suphp, then it shows up correctly, exactly the same script.

    I've double checked user and group on the file and its parent directory. I've also checked file permissions and they are set properly. Every other php script in the website is funcioning correctly without errors. Only the phpinfo(); is giving me the error.

    I also looked into my disabled php functions to see if it was there the problem, and phpinfo was not in it.

    I'm hoping someone could share some knowledge or directions where to look next to figure out what this may be.

    My system is a Virtuozzo Container running Linux ****** 2.6.18-028stab069.6 #1 SMP Wed May 26 18:10:06 MSD 2010 x86_64 x86_64 x86_64 GNU/Linux

    cPanel 11.25.0-R46156 - WHM 11.25.0 - X 3.9
    CENTOS 5.5 x86_64 virtuozzo on ****

    Any help is appreciated.

    Jose R. Lopez
     
  2. nxweb

    nxweb Active Member

    Joined:
    Oct 29, 2008
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    My guess is that one of your extensions is probably depending on a library that PHP is not able to load in the fastcgi environment. Since the phpinfo(); is loading everything then it's bound to error on this. You can check this by running ldd on all the .so's loaded by your PHP build to see if any libraries it depends on are no in the /lib or /usr/lib etc.

    Other than that, my only other guess is that it's a premature end of headers issue. Make sure there are no blank spaces or lines after the closing PHP tag.
     
  3. momon

    momon Registered

    Joined:
    Jun 22, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    the problem was in fact something simple I had overlooked. I was compiling using easy apache to the latest php version (5.3). After clicking around I realized that there was no fastcgi option in php (in easyapache). So I went back to php 5.2 which had the option for fastcgi and was able to compile it then.

    It proved to be working after doing this, except I had no control over php settings using the wrapper cgi script (there is a guide in another post for this). So I decided to go back to 5.3 and suphp instead where I do have control over php.

    I now wonder, is there a reason why easyapache using php 5.3 does not have an option to enable fastcgi? I know this is not the recommended enviorement recommended by cpanel but I am curious about why the option is there for 5.2 and not 5.3.

    Thanks.

    Jose R. Lopez
     
  4. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Coralville, Iowa USA
    There are some components that don't yet work with 5.3 and PHP's FastCGI module might be one of them when cPanel first released 5.3. I don't know if this would still be the case or not. You might send a ticket to cPanel technical support to see if that might have been an oversight (or whether FastCGI still isn't compatible with PHP 5.3 version).

    When you mention not having control over php settings, what do you mean precisely? You weren't able to get individual php.ini file's working? I have a guide up on how to get them working (this worked for me on my machine that runs fcgi on it):

    Allow a Custom php.ini File on PHP as FCGI (CentOS using cPanel) - errorCodex - Computer Questions & Solutions Forum

    The reason I say this is that if you managed to get it working, FCGI has a slew of benefits over suPHP. For one, it's a lot faster and produces lower load levels. For another, it allows actual PHP caching to work (like DSO does) via EAccelerator (EAccelerator and PHP caching options will not work with suPHP due to it not being persistent).

    I have a chart I created comparing the various handlers, so you can see what each has available for it:

    PHP Handler (CGI, DSO, FCGI, suPHP) Chart Comparison - errorCodex - Computer Questions & Solutions Forum

    Now, depending on your server's activity and size, suPHP might work fine. It's really only an active machine that needs optimizing where FCGI is the preferred choice.
     
Loading...

Share This Page