php memory limits

Discussion in 'Server Operation' started by lifeisboost, Jul 27, 2006.

  1. lifeisboost

    lifeisboost New Member

    okay i have edited my php.ini file and restarted apache a dozen times. i have even rebooted the server. but i cannot get php to reconize the upgraded memory limits. i have changed it from 8-64 but if i run a php info on it, i still only see 8 megs. is there something im missing? i edited the correct file. it was the one listed on the php info page.

    im running FC4 with php5
     
  2. Ben

    Ben Active Member Moderator

    normally not. But sure you edited the right php.ini (for the case you have more than one)?
    What happens when running php from console and checking the output of phpinfo()?
     
  3. blackbeard

    blackbeard New Member

    Which memory limit's are you setting? I run php 4 at work, so this may or may not apply to php 4.

    Under Resource Limit, set memory_limit.

    Under Data Handling, set post_max_size.

    Under File Uploads, set upload_max_size.

    Hope this helps.
     
  4. lifeisboost

    lifeisboost New Member

    I have edited all of those resources to 64m

    these are the only 2 locations for php.ini

    /etc/php.ini
    /root/ispconfig/php/php.ini ( i know this one is not it )

    and the etc/php.ini is th eone listed in phpinfo. i still only see 8 megs :(
     
  5. blackbeard

    blackbeard New Member

    64m or 64M?

    I believe that it is case sensitive. Also, try this to make sure that new limits really are saved:

    more /etc/php.ini | grep "memory_limit"

    more /etc/php.ini | grep "post_max_size"

    more /etc/php.ini | grep "upload_max_filesize"
     
  6. blackbeard

    blackbeard New Member

    Also, found this in the php4 manual:

    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.
     
  7. lifeisboost

    lifeisboost New Member

    yes it is enabled as it shows in php.ini --enable-memory-limit'

    all entries are 64M

    [root@G35 ~]# more /etc/php.ini | grep "memory_limit"
    memory_limit = 64M ; Maximum amount of memory a script may consume (8MB)
    [root@G35 ~]# more /etc/php.ini | grep "post_max_size"
    post_max_size = 64M
    [root@G35 ~]# more /etc/php.ini | grep "upload_max_filesize"
    upload_max_filesize = 64M


    im at a loss :(
     
    Last edited: Jul 28, 2006
  8. Ben

    Ben Active Member Moderator

    Again my question, does running a php script from shell return the same when displaying phpinfo() ?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Have you restarted your apache webserver after changing the php.ini values?
     
  10. lifeisboost

    lifeisboost New Member

    yes i have restarted apache and even rebooted the server a number of times. php info still shows 8 megs :(
     
  11. falko

    falko Super Moderator Howtoforge Staff

    Can you post the URL to your phpinfo page here?
     
  12. lifeisboost

    lifeisboost New Member

  13. sjau

    sjau Local Meanie Moderator

    Does it show as local or global value 8 megs? Maybe you can take a screenshot?
     
  14. lifeisboost

    lifeisboost New Member

    it shows 8m in all of the sites. this server is just for one client and their sites.
     
  15. sjau

    sjau Local Meanie Moderator

    if you use the function phpinfo() it will return a global and local value for the max mem allocation. Is it both the same for the global and local value?
     
  16. Ben

    Ben Active Member Moderator

    As you can see at the link above, local and global value are the same.

    One question the 3rd time, what gives you phpinfo() when running php from cli?
    What happens if you rund php from the cli like this:
    php -c /etc/php.ini
     
  17. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    ls -l /etc/php.ini
    ? Because it says on your phpinfo page:

    and I think it should show

    instead...
     
  18. lifeisboost

    lifeisboost New Member


    if i run the command as you ask it just drops to a blank line and sits there...



    here you go Falko

    [root@G35 ~]# ls -l /etc/php.ini
    -rw-r--r-- 1 root root 44118 Jul 26 19:19 /etc/php.ini
     
  19. falko

    falko Super Moderator Howtoforge Staff

  20. Ben

    Ben Active Member Moderator

    @lifeisboost: Sorry I was a bit unprecisely. I ment calling php with a fille containing phpinf() call... but you can also run

    php -r "phpinfo();" | grep php.ini
    or
    php -c /path/php.ini -r "phpinfo();" | grep php.ini

    and check what the output is. If it shows the correct php.ini location in both cases then you should leave out the grep and check what memory_limit is displayed. if they are different than php can not "dynamically" find the location for the php.ini with the compiled in parameter...

    if it works I would guess mod_php does not know where to look for a ini file.

    Did you compile your php your own? T
     

Share This Page