Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jan 2006
    Posts
    654

    Default Easyapache PHP --enable-memory-limit

    Hi Folks,

    Does anyone know at what point Easyapache stopped compiling PHP with --enable-memory-limit ?

    In the past this was always included in every build as standard but I have only noticed recently that this is no longer the case. We had a customer with a PHP script containing an infinate loop which used up all the memory on one of our servers. I was caught blissfully unaware!

    There doesnt even seem to be an option in the build list - so now we have to make manual changes to get this in, which is rather inconvenient.

    Is it perhaps a bug?

  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: Easyapache PHP --enable-memory-limit

    Which PHP version is being used on the machine? After PHP 5.2.1, this doesn't have to be set at compile time to be used to set the memory_limit variable in /usr/local/lib/php.ini file. This is per the following link:

    PHP: Description of core php.ini directives - Manual
    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
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jan 2006
    Posts
    654

    Default Re: Easyapache PHP --enable-memory-limit

    Thanks Tristan, we are using mostly 5.2.9 and now 5.2.17. I've seen this issue on a number of servers and this most recent one is quite worrying as it took a while to locate the problem script. Luckily we had set the kernel to restart the server when it reaches an OOM state.

    We have memory_limit set in the php.ini correctly and its showing up in "phpinfo" but it appears to be not working. The customers are unable to overrride the system php.ini with ini_set or by uploading their own, so I'm at a loss as to exactly why this happened. I notice that when this happens, its the parent Apache process that is showing the high memory usage.

    I'll do some testing with a script that takes up more than the memory limit and see if the correct errors are produced in the error log. I suspect they wont be. I'd welcome any suggestions about why the PHP memory_limit directive might not be working.

    Added: Could this possibly be related to the Apache "Memory usage restrictions" option in cpanel? We always use this.
    Last edited by 4u123; 06-24-2011 at 03:41 AM.

  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 Re: Easyapache PHP --enable-memory-limit

    Regardless of the Apache memory usage restrictions, the memory_limit variable for /usr/local/lib/php.ini should be respected so long as the machine is running 5.2.1 or higher. If you are unable to get the memory restrictions to be respected using 5.2.9 or 5.2.17 upon testing, please do open up a ticket and provide a script for us to test this happening.
    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. How to activate '–enable-memory-limit' configure option, in WHM/SSH?
    By basketmen in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-29-2011, 05:34 PM
  2. php memory limit
    By herbertjoei in forum New User Questions
    Replies: 13
    Last Post: 07-17-2007, 06:21 AM
  3. Enabling PHP memory limit - anyone done so?
    By webignition in forum New User Questions
    Replies: 3
    Last Post: 01-24-2005, 03:40 PM
  4. php memory limit
    By futuron in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 01-02-2005, 11:06 PM
  5. enable-memory-limit in PHP
    By kaesar in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 11-15-2004, 01:18 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube