Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 14 of 14
  1. #1
    Member
    Join Date
    Aug 2005
    Posts
    20

    Question php memory limit

    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. #2
    Member
    Join Date
    Oct 2006
    Posts
    191

    Default

    After you make the change make sure to restart Apache Service in WHM. This will make the changes take effect.
    Owner/President
    Booyah! Web Hosting
    Great Personal Service
    Experience the Booyah! Difference

  3. #3
    Member
    Join Date
    Aug 2005
    Posts
    20

    Default

    Hi,

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

  4. #4
    aby
    aby is offline
    Member aby's Avatar
    Join Date
    May 2005
    Location
    India
    Posts
    638

    Default

    Quote Originally Posted by herbertjoei View Post
    Hi,

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

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

    MSN "abyvarghese007"
    Yahoo " abyattaikkulathu"

    http://slashome.com

  5. #5
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    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. #6
    Member
    Join Date
    Oct 2006
    Posts
    191

    Default

    If you have Zend installed make sure you are editing /usr/local/Zend/etc/php.ini
    Owner/President
    Booyah! Web Hosting
    Great Personal Service
    Experience the Booyah! Difference

  7. #7
    Member
    Join Date
    Aug 2005
    Posts
    20

    Default

    Well, i checked my phpinfo and yes I cleared my cache . The path was correct at: /usr/local/lib/php.ini but still there was no memory_limit in the output. Is this normal?

  8. #8
    Member
    Join Date
    Oct 2006
    Posts
    191

    Default

    Did you restart Apache?
    Owner/President
    Booyah! Web Hosting
    Great Personal Service
    Experience the Booyah! Difference

  9. #9
    Member
    Join Date
    Nov 2006
    Location
    Lithuania
    Posts
    122

    Default

    Quote Originally Posted by herbertjoei View Post
    Well, i checked my phpinfo and yes I cleared my cache . The path was correct at: /usr/local/lib/php.ini but still there was no memory_limit in the output. Is this normal?
    Run
    Code:
    pico /usr/local/lib/php.ini
    and look for memory_limit = 8M and change it to whatever you like. Then restart httpd.
    Gytis Repecka aka Kelmas
    NFS Tuning / AutoNews.lt webmaster, IT journalist

  10. #10
    Member
    Join Date
    Aug 2005
    Posts
    20

    Default

    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. #11
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    According to the PHP documentation, it must be enabled both at compile time, and in the php.ini file:

    memory_limit integer
    This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a server. In order to use this directive you must have enabled it at compile time. So, your configure line would have included: --enable-memory-limit. Note that you have to set it to -1 if you don't want any limit for your memory.

    As of PHP 4.3.2, and when memory_limit is enabled, the PHP function memory_get_usage() is made available.

    When an integer is used, the value is measured in bytes. You may also use shorthand notation as described in this FAQ.

  12. #12
    Member
    Join Date
    Oct 2006
    Posts
    191

    Default

    Could it possible that his application is using a different php.ini file?
    Owner/President
    Booyah! Web Hosting
    Great Personal Service
    Experience the Booyah! Difference

  13. #13
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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. #14
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jan 2006
    Posts
    654

    Default

    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

Similar Threads & Tags
Similar threads

  1. php Memory Limit not Respected...?
    By Phylum in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 07-13-2011, 08:50 PM
  2. Memory limit errors in PHP
    By 4u123 in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 07-25-2007, 08:42 AM
  3. Memory Limit problem in PHP 4.3.3 (I think)
    By Ixel in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-07-2005, 12:06 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