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.

Individual/Custom PHP Configuration on FCGI Server

Discussion in 'General Discussion' started by vectro, Jan 9, 2012.

  1. vectro

    vectro Member

    Joined:
    Sep 2, 2008
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    This is partially in reference to these threads:

    http://forums.cpanel.net/f5/fastcgi-fcgid-php-ini-per-user-100133.html
    http://forums.cpanel.net/f5/individual-php-ini-files-php-fcgi-php-cgi-160398.html

    I more or less followed the instructions there and I came up with the following settings:

    /home/username/public_html/cgi-bin/php.fcgi
    Code:
    #!/bin/sh
    export PHP_FCGI_CHILDREN=1
    export PHP_FCGI_MAX_REQUESTS=10
    exec /usr/local/cpanel/cgi-sys/php5
    
    /usr/local/apache/conf/userdata/std/2/username/custom.conf
    Code:
    AddHandler php5-fastcgi .php
    Action php5-fastcgi /cgi-bin/php.fcgi
    
    /usr/local/apache/conf/includes/pre_virtualhost_2.conf
    Code:
    Action php5-fastcgi /cgi-bin/php.fcgi
    AddType application/x-httpd-php .php
    
    The custom php.ini is placed in /home/username/public_html/cgi-bin/

    When I implement this, the site shows error code 500. It appears it is being isolated to its own PHP configuration, because none of the other sites on the server seem to have a bad reaction. However, it won't load and there is no PHP error_log file with any data. Error logging is enabled for the custom PHP configuration. Even when it's temporarily enabled on the server's main PHP configuration it still shows no data. The Apache log shows this error:

    Code:
    [Thu Jan 05 11:10:22 2012] [error] [client {IP-REMOVED}] Premature end of script headers: php.fcgi, referer: http://www.{URL-REMOVED}
    
    Does anyone have any advice on how to resolve this?
     
  2. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    Are you getting the same error on a simple phpinfo page placed in the site as well.
     
  3. vectro

    vectro Member

    Joined:
    Sep 2, 2008
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    I'm terribly sorry for my delay in this response as I did not have e-mail notifications on and was not aware you replied. I've only recently become active in this forum again and noticed. Thank you for the response as belated as this is. I have concluded that custom PHP configurations are better suited for suPHP servers and gave up on this a while back.
     
Loading...

Share This Page