Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Custom php.conf how to preserve cpanel from overwriting it?

Discussion in 'General Discussion' started by palav0s, Jul 15, 2011.

  1. palav0s

    palav0s Well-Known Member

    Joined:
    Jul 15, 2011
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    56
    Hello,

    I would like to find out how can I make a custom php.conf suffice future updates or rebuilds.

    From the Using Custom Configure Flags section of cpanel documenation.

    Since it's php version 5.x.x I create this file /var/cpanel/easy/apache/rawopts/all_php5
    ... and then passing the arguments as the example:

    Code:
    --with-flag
    
    --path-to-flag=/usr/bin/flag
    
    --my-option= 
    :confused: But how do I pass these arguments?

    I would like to pass the following options:
    Code:
    FcgidConnectTimeout 20
    MaxRequestLen 157286400
    Thanks
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,608
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Rather than putting them into /usr/local/apache/conf/php.conf file, please try putting them into /usr/local/apache/conf/includes/pre_virtualhost_global.conf file. That file will not be overwritten on Apache updates.

    After adding values to that file, you would need to run these commands:

    Code:
    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak110715
    /usr/local/cpanel/bin/apache_conf_distiller --update
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. palav0s

    palav0s Well-Known Member

    Joined:
    Jul 15, 2011
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    56
    Thank you for your response Tristan.
     
  4. palav0s

    palav0s Well-Known Member

    Joined:
    Jul 15, 2011
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    56
    /usr/local/apache/conf/includes/pre_virtualhost_global.conf file is only for the php.conf ?
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,608
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    No, it isn't only for the php.conf file contents that you want to add. It can be used for anything that needs to be global right before the VirtualHost entries in the httpd.conf file.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. palav0s

    palav0s Well-Known Member

    Joined:
    Jul 15, 2011
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    56
    A "silly" question(?) how it differentiates that the configuration I entered there (in usr/local/apache/conf/includes/pre_virtualhost_global.conf file) is for the php.conf file or another config file?

    Thanks for your response Tristan.
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,608
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If you are prepending your entries with FcgidName such as FcgidIdleTimeout, then it is apparent to Apache how to handle the request. Otherwise, you can always wrap them in an If statement such as:

    Code:
    <IfModule mod_fcgid.c> 
    FcgidIdleTimeout 300 
    FcgidIdleScanInterval 120 
    FcgidProcessLifeTime 600 
    FcgidIOTimeout 600 
    FcgidMinProcessesPerClass 0 
    FcgidMaxProcessesPerClass 4
    </IfModule>
    Of note, the above is just an example configuration not a recommendation for values.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice