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.

Easyapache PHP --enable-memory-limit

Discussion in 'EasyApache' started by 4u123, Jun 23, 2011.

  1. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    765
    Likes Received:
    1
    Trophy Points:
    18
    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. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    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
     
  3. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    765
    Likes Received:
    1
    Trophy Points:
    18
    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.
     
    #3 4u123, Jun 24, 2011
    Last edited: Jun 24, 2011
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page