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.

php.ini for one user

Discussion in 'General Discussion' started by NLCJ, Dec 26, 2010.

  1. NLCJ

    NLCJ Member

    Joined:
    Sep 25, 2009
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,
    I've got a dedicated server with cPanel. A lot of friends have an account on it, no commercial use. But I don't trust all of those friends, I think the chance that one of those friends breaks the server or uses it for wrong purposes is big. The problem is: I am creating a website where users can upload files, everything is working great, but these files can be up to 5GB. Is there a possibility to set a php.ini for one user? So that my account got limits of 5GB while others still got limits of 8MB?

    Thanks,
    NLCJ
     
  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
    You can copy a server level php.ini from /usr/local/lib/php.ini into a folder say /home/user/phpconfig and then add the line below to the .htaccess file of your account.

    Code:
    suPHP_ConfigPath /home/user/phpconfig
    You can then update the variable upload_max_filesize in this local file to 5GB.

    Note: You are allowed to use a local php.ini if you are running SuPHP. You can confirm and/or change this in WHM under the tab "Service Configuration >> Apache Configuration >> Configure PHP and SuExec > PHP 5 Handler".

     
  3. wayne_mu

    wayne_mu Member

    Joined:
    Dec 12, 2009
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    As JawadArshad said , you can copy the server's php.ini into the account.

    You can get the the path of the php.ini from the command :

    Mostly it's /usr/local/lib/php.ini .

    Then you can copy php.ini under /home/username/public_html . I suggest you not to change the ownership of php.ini (that is keep it as root so that the user won't be able to make any changes to it).

    After copying , you can write the following code unde the account's .htaccess

    that is the path of php.ini .

    The above will make the settings under php.ini be applicable to the entire account.

    If you want the change to be applicable only for a subfolder, then you can copy the server's php.ini under that subfolder and then you can write the code as below under the .htaccess

    Hope this helps :)

    -----------------------------------------------
    esds Data Center
     
Loading...

Share This Page