Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    May 2008
    Posts
    48

    Default customized php.ini

    Is there any way in cpanel with the help we can allow our clients to run their on php.ini files but with limited values ?

    Lets suppose to allow clients to specify their own memory limit in their own custom php.ini file but if they try to set memory limit greater then 100 MB or any value that is very high then they should not be able to do it.

    We need this as some websites require more memory then others but if we set any value in global php.ini then it will be assigned to all of the websites not to the specific one.

  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

    Which PHP handler and PHP version are you using? The answer will depend on your PHP handler and version.

    If you are using PHP 5.3+, you can define path variables in the global php.ini file:

    Code:
    [PATH=/home/username/public_html]
    memory_limit=100M
    For each user that you want to allow the higher limit, simply put the path to that user's home directory, then the changes to the variables you want to allow. I'd put this at the bottom of the /usr/local/lib/php.ini file. This will only work on PHP 5.3+ not PHP 5.2

    It should conceivably work for the various PHP handlers, but I've only tested it on FCGI and suPHP. Prior to PHP 5.3, I have no idea how you'd accomplish what you want to accomplish in suPHP. In DSO for PHP 5.2, you might be able to define the values in include files in /usr/local/apache/conf/userdata/std/2/username (where username is the cPanel username) location with php_value memory_limit 100M to hard code it.
    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
    May 2008
    Posts
    48

    Default

    Unfortunately we are using 5.2 and can not upgrade on php 5.3 at the moment as some websites are not compatible with it.

    We are using CGI handler. Is it better to use DSO or FastCGI. What are their advantages over CGI

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

    Root Administrator

    Default

    I have a handler comparison chart you can use. I did have it up on my forum, but I don't have that online right now, so just attaching it here.

    Personally, if you are running CGI, you would be better going to FCGI or suPHP, since CGI isn't terribly fast anyway. There's no speed benefit nor high security benefit for CGI over DSO either.
    Attached Thumbnails Attached Thumbnails customized php.ini-phphandlers2.png  
    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. Individual php.ini files for PHP FCGI and PHP CGI
    By Miraenda in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 08-22-2011, 08:55 AM
  2. php.ini and override default php.ini
    By areh in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 08-24-2009, 05:45 PM
  3. Updating cpanel PHP changed main server php.ini
    By 4u123 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-06-2009, 02:46 PM
  4. Question about PHP security, setting up multiple php.ini files?
    By sirbrent in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-01-2008, 10:58 AM
  5. Disabling local php.ini while php still runs in SUExec mode
    By gizmoh in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-10-2005, 11:34 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube