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 memory limit

Discussion in 'General Discussion' started by herbertjoei, Feb 19, 2007.

  1. herbertjoei

    herbertjoei Member

    Joined:
    Aug 9, 2005
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I've been trying to search this forum for an answer but I can't seem to find one.

    Question: How do i increase the PHP memory limit per domain? The script i am trying to install recommends at least 16MB and the server is currently at 8mb even though i changed the parameter in php.ini found in /usr/local/lib

    Thanks in advance!
     
  2. Fernis

    Fernis Well-Known Member

    Joined:
    Oct 28, 2006
    Messages:
    192
    Likes Received:
    1
    Trophy Points:
    18
    After you make the change make sure to restart Apache Service in WHM. This will make the changes take effect.
     
  3. herbertjoei

    herbertjoei Member

    Joined:
    Aug 9, 2005
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I already did that and the application still reports 8M?? This is wierd, there's no memory limit variable in my PHPINFO.
     
  4. aby

    aby Well-Known Member

    Joined:
    May 31, 2005
    Messages:
    638
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India

    If you do have zend installed, then the location of php.ini will be different. Do you have zend installed ?
     
  5. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Check your phpinfo() screen for the location of your correct PHP.INI file ...

    It could be the one in /usr/local/lib but not necessarily and that goes
    double important if you are using phpSuExec or SuPHP

    Once you have edited the correct PHP.INI file then all you should need
    to do is restart Apache to make the changes effective.

    PS: Clear your web browser cache! One of the most common mistakes
    when making system changes is to fail to clear your web cache which will
    often make you think changes haven't been applied when in reality,
    they have indeed been applied and working.
     
  6. Fernis

    Fernis Well-Known Member

    Joined:
    Oct 28, 2006
    Messages:
    192
    Likes Received:
    1
    Trophy Points:
    18
    If you have Zend installed make sure you are editing /usr/local/Zend/etc/php.ini
     
  7. herbertjoei

    herbertjoei Member

    Joined:
    Aug 9, 2005
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Well, i checked my phpinfo and yes I cleared my cache :D. The path was correct at: /usr/local/lib/php.ini but still there was no memory_limit in the output. Is this normal?
     
  8. Fernis

    Fernis Well-Known Member

    Joined:
    Oct 28, 2006
    Messages:
    192
    Likes Received:
    1
    Trophy Points:
    18
    Did you restart Apache?
     
  9. Kelmas

    Kelmas Well-Known Member

    Joined:
    Nov 6, 2006
    Messages:
    121
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lithuania
    Run
    Code:
    pico /usr/local/lib/php.ini
    and look for memory_limit = 8M and change it to whatever you like. Then restart httpd.
     
  10. herbertjoei

    herbertjoei Member

    Joined:
    Aug 9, 2005
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    hi,

    Yep. I did restart apache and I did edit the php.ini and still the same. I verified this by checking php.ini after saving and restarted httpd via WHM and still missing memory_limit in phpinfo() and application still detects 8M.. wierd huh?
     
  11. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,460
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    According to the PHP documentation, it must be enabled both at compile time, and in the php.ini file:

     
  12. Fernis

    Fernis Well-Known Member

    Joined:
    Oct 28, 2006
    Messages:
    192
    Likes Received:
    1
    Trophy Points:
    18
    Could it possible that his application is using a different php.ini file?
     
  13. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,460
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Recent versions of PHP disabled the ability to have custom php.ini files in home directoreis (or anywhere else). Now, the location is defined at compile time.

    That said, the PHP module could/would use a different php.ini than the CGI version, likewise if using the Zend extension.
     
  14. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    765
    Likes Received:
    1
    Trophy Points:
    18
    Can you confirm....

    If I dont compile memory_limit into PHP - changing the memory limit in php.ini will have no effect ?

    I've never come across that before - usually its fine but we have a customer getting an out of memory (8MB) message and the server's php.ini is set to 32M
     
Loading...

Share This Page