Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Jul 2011
    Posts
    23

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

    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.

    [...]
    Create the file that corresponds to the version of Apache or PHP for which you would like to add a custom configure flag.
    In the file, enter the flag you wish to add.
    The file will be parsed, and the options properly formatted before EasyApache adds them to the data structure.
    See the example below for more information about formatting your custom flags.
    Save the changes you have made to the file.
    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=
    But how do I pass these arguments?

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

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

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

    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
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Member
    Join Date
    Jul 2011
    Posts
    23

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

    Thank you for your response Tristan.

  4. #4
    Member
    Join Date
    Jul 2011
    Posts
    23

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

    Quote Originally Posted by cPanelTristan View Post
    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.
    /usr/local/apache/conf/includes/pre_virtualhost_global.conf file is only for the php.conf ?

  5. #5
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

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

    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.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  6. #6
    Member
    Join Date
    Jul 2011
    Posts
    23

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

    Quote Originally Posted by cPanelTristan View Post
    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.
    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. #7
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

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

    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.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. Preserve httpd.conf during recompile
    By kives in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-03-2009, 05:41 AM
  2. Preventing cPanel from overwriting custom Exim ACL
    By meeven in forum E-mail Discussions
    Replies: 2
    Last Post: 05-13-2009, 05:47 AM
  3. Manually editing httpd.conf despite cPanel recreation/overwriting
    By Kadence in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 01-22-2008, 11:30 AM
  4. cpanel overwriting php.ini
    By tifosi in forum New User Questions
    Replies: 5
    Last Post: 06-27-2007, 07:22 AM
  5. BUG? Cpanel overwriting httpd.conf
    By garak in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-23-2005, 12:06 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube