Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member monarobase's Avatar
    Join Date
    Jan 2010
    Location
    France
    Posts
    387
    cPanel/Enkompass Access Level

    Root Administrator

    Default Ability to increase amount of memory allowed by cPanel PHP

    Currenty the amount of memory allowed in /usr/local/cpanel/3rdparty/etc/php.ini is only 128M

    In some cases it is necessary to have more than this.

    Here is an example :

    I've got a 10Mb .CSV file that when zipped takes up 1.5Mb. It contains about 35 columns and lots of lines and when I want to import it in phpMyAdmin (zipped to prevent timeout when sending it) I get out of memory errors stating that I have gone over the 128Mb limit.

    When you edit the php.ini file to allow more than 128M (256M in my case) the change is lost as soon as you restart cPanel.

    Currenty (according to cPanel support) there is no way to increase this value, /usr/local/cpanel/bin/install_php_inis does not work and they say I can only change the values in the Tweak settings. For some reason that I do not understand, the amount of memory cPanel PHP can use is not in the Tweak settings.

    We need to be able to increase the pretty low 128M value to a decent 256 or 512M (which isn't much as lots of servers now have over 20Gigs of ram).

    We need to have some means of setting this memory limit urgently. In the tweak settings would be the best place but any way of doing this will suit our needs.

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

    Root Administrator

    Default Re: Ability to increase amount of memory allowed by cPanel PHP

    Hello monarobase,

    I've taken over your ticket as well (ticket 1560034) to see if there is a way to temporarily increase this limit until this feature request has had consideration.

    If I find any method to change the value temporarily that will override the cPanel restart (cpsrvd specifically being the process reverting it), then I will also be updating this thread.

    Thanks.
    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 monarobase's Avatar
    Join Date
    Jan 2010
    Location
    France
    Posts
    387
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Ability to increase amount of memory allowed by cPanel PHP

    Thank you,

    If necessary well will install a separate PHPmyAdmin for this user. Not being able to edit the php.ini file does have quite a few limitations.

    One thing I was thinking about doing was to install PECL upload progress so that phpmyadmin can show the upload progress when uploading large database backups but I guess this won't be possible either and would probably need a new feature request… Maybe for an include file for the php.ini that would all us to add as well as overwrite existing settings.

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

    Root Administrator

    Default Re: Ability to increase amount of memory allowed by cPanel PHP

    I've replied to the ticket. The file that writes the /usr/local/cpanel/3rdparty/etc/php.ini file is /usr/local/cpanel/3rdparty/etc/php.ini.dist one in the same location. If you change a value in /usr/local/cpanel/3rdparty/etc/php.ini.dist file, it will then use the value in the /usr/local/cpanel/3rdparty/etc/php.ini file on cPanel or cpsrvd restart.

    I also recommended putting /usr/local/cpanel/3rdparty/etc/php.ini.dist into the cPanel exclude list so that upcp doesn't overwrite the file:

    echo "/usr/local/cpanel/3rdparty/etc/php.ini.dist" >> /etc/cpanelsync.exclude
    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

  5. #5
    Member monarobase's Avatar
    Join Date
    Jan 2010
    Location
    France
    Posts
    387
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Ability to increase amount of memory allowed by cPanel PHP

    Thank you,

    I still maintain my feature request although you have given me a workaround that will do for the time being.

  6. #6
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Lightbulb Re: Ability to increase amount of memory allowed by cPanel PHP

    I recommend to consider using the postupcp script hook, where you would setup a custom script that applies any needed customizations or executes other scripts to perform the desired changes. The postupcp script hook is automatically executed after cPanel & WHM updates are performed; you would simply need to ensure your custom postupcp script exists and is executable.

    Example contents of /scripts/postupcp:
    Code:
    #!/bin/sh
    perl -pi -e 's/^memory_limit\s*=\s*\d+M/memory_limit = 256M/g' /usr/local/cpanel/3rdparty/etc/php.ini.dist
    /usr/local/cpanel/bin/checkphpini
    /usr/local/cpanel/bin/install_php_inis
    Additional script hook information is detailed in the following documentation: cPanel & WHM Script Hooks
    Last edited by cPanelDon; 06-01-2011 at 05:09 PM. Reason: Clarification

  7. #7
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default Re: Ability to increase amount of memory allowed by cPanel PHP

    Quote Originally Posted by monarobase View Post
    I still maintain my feature request although you have given me a workaround that will do for the time being.
    Personally, I would very much like to see your feature request implemented; I believe as more cPanel & WHM users and system administrators express interest in your feature request it may be considered for a future version.

  8. #8
    Member
    Join Date
    Jan 2008
    Location
    Buenos Aires, Argentina
    Posts
    942
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Ability to increase amount of memory allowed by cPanel PHP

    And what about an extra memory limit only for phpmyadmin? is that posible? Because setting the PHP memory limit to a higher value may allow other users to monopolize memory usage.

  9. #9
    Member monarobase's Avatar
    Join Date
    Jan 2010
    Location
    France
    Posts
    387
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Ability to increase amount of memory allowed by cPanel PHP

    I think the right value depends on how much memory you have got per account. On servers with 64 gigs and less than 400 accounts, setting cPanel's limit to 512 Mb should not be too much of a problem, however if you have only got 8 Gb of memory and 500 accounts then you might not want such a high value. Don't forget this is cPanels PHP and not actual sites limit.

Similar Threads & Tags
Similar threads

  1. Increase Virtual Memory
    By ghog in forum New User Questions
    Replies: 8
    Last Post: 07-14-2010, 07:36 AM
  2. Ability to limit account and plan by cpu/memory instead of just by disk/bw.
    By electric in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 10-29-2007, 09:26 AM
  3. Really dumb question about memory increase
    By pqhost in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 01-08-2007, 12:08 PM
  4. modify allowed memory usage for php/apache?
    By chadi in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 08-06-2004, 08:58 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube