Community & Support

How to Check & increase memory limit

Hi.
1) How to check if there's any upper limit of memory in my web hosting? If s, how much?
2) What is the best way to increase my memory limit?
There're 3 ways:
- php.ini
- index.php
- settings.php

Which one should I edit?
What're the pros and cons?
What code do I need to add (for each file separately)?

Thanks!

Comments

Any help?

Any help?

I'm using Drupal 4.6.3
Thanks for people who are eager to help me :D

Admin - module not loading in Drupal - Memory Limit

If you run out of PHP memory. You'll need to either uninstall some modules or increase the memory_limit variable in php.ini.

/etc/php4/apache2/php.ini
; change from 8MB to 16MB
memory_limit = 16M ; Maximum amount of memory a script may consume (8MB)

Are Casilla
http://astartelecom.com - Independent VOIP Telecoms Broker. Consulting in Asterisk and Drupal
http://astbill.com - Billing, Routing and Management software for Asterisk and MySQL. Running on Drupal
AstBill DEMO: http://demo.astbill.com

I can't even find etc in my

I can't even find etc in my main folder, and in public_html folder.
Out of luck :(
Probably my web hoster hid it.

I'm using Drupal 4.6.3
Thanks for people who are eager to help me :D

settings.php

Add this to your settings.php:

ini_set('memory_limit', '100M');

It worked for me on a server that I have no control over. I had to set the limit so high in order to get some image conversions to work...

Would you mind doing me a favour?

Hey.
It seems the above doesn't work.
I don't know what's wrong.
What web hoster are you using?

After all, would you mind trying to do the following:

1) Create an info.php

<?php
phpinfo
();
?>

2) Upload it to anywhere in your website.
Then access it.

3) A page will load up showing you a lot ofinformation about PHP.
Look for the following info:
........................Configuration

..........................PHP Core

Directive.........Local Value......Master Value
.....
memory_limit....?M................?M (<-- Look for these values!)

Tell me what're the value of the above in your case.
Thanks a lot.

I'm using Drupal 4.6.3
Thanks for people who are eager to help me :D

Hmm

It worked for me on a server running Linux with Apache 1 and PHP 4. My phpinfo says the memory limit is 8M in both cases which it really isn't, though, because my webapp crashed hard before I set the limit higher.

It seems the phpinfo is not

It seems the phpinfo is not reliable. :P
So I think the settings will work on my server too.

I'm using Drupal 4.6.3
Thanks for people who are eager to help me :D

No memory_limit shown in phpinfo()

I am trying to find out what my memory_limit is, but phpinfo() simply doesn't report the value.

I searched for "memory" and then just "mem"

Shared Host
Apache 1.3.37
PHP 4.4.4
Zend Memory Manager enabled
Server API CGI

Can someone explain why the value isn't there?

Same

I've placed php.ini files in numerous locations, and I also tried the ini memory directive in .htaccess.

No memory limit is shown in phpinfo() in the root Drupal directory.

No limit show because there is no limit

My host has php running via CGI rather than as an apache module (I know this isn't a good setting for drupal or any other app that does lots of small bits of php & sql). There is no memory limit set. Well I am sure there is a limit but its handled by the OS and not php.

php.ini

php.ini is the best way.

However, this will work only if your hosting company allows such setting in such file.

--
Drupal development and customization: 2bits.com
Personal: Baheyeldin.com

--
Drupal performance tuning, development, customization and consulting: 2bits.com, Inc.
Personal blog: Baheyeldin.com.

I am allowed to create

I am allowed to create php.ini
But how can I know if the settings work?

I'm using Drupal 4.6.3
Thanks for people who are eager to help me :D

How to check? Use the

How to check? Use the venerable phpinfo function and look for the settings or ask your host provider.

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

It appears none of the methods work?!?

Hi.
Here's what I once tried to add memory_limit code in:
- php.ini
- settings.php

Then I tried to verify the change by uploading 7 running this *.php:

<?php
phpinfo
();
?>

the following info shows:
........................Configuration

..........................PHP Core

Directive.........Local Value......Master Value
memory_limit....8M................8M

Why no change is made?
Does it mean that the memory_limit setting fails?
Is the result reliable to tell no change occurs?

Thanks.

I'm using Drupal 4.6.3
Thanks for people who are eager to help me :D

if you have changed a

if you have changed a setting in php.ini you would need to restart the apache service for the change to take effect

nobody click here