I am getting the following error when i save the configuration on /admin/build/modules page.

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1041532 bytes) in /path-to-website/includes/database.mysql-common.inc on line 41

My PHP memory limit was 32M which i have increased to 64M now (by requesting to my web host).
But still i am getting the same problem.
Also on my admin/reports/status page i am still seeing PHP Memory limit as 32M.
Any help would be appriciated!!
Thanks

Comments

WorldFallz’s picture

Also on my admin/reports/status page i am still seeing PHP Memory limit as 32M.

Then it's not been changed. Until you see the change here, it's not effective.

aac’s picture

Thanks for your prompt response!!
You are right....when i click on the version number in front of PHP on the status report page then it opens phpinfo which clearly states PHP Memory limit as 32M (not 64M).

---~~~***~~~---
aac

vm’s picture

use a text editor create a php.ini file
add to this file
memory_limit = 64M

upload it to your drupal installation

check phpinfo()

cog.rusty’s picture

How did you change it? The PHP memory_limit can be set in three places, in php.ini, in .htaccess, or in sites/default/settings.php. (http://drupal.org/node/207036). If it is set in more than one places, settings.php wins.

aac’s picture

Earlier i have not changed anything...just requested to my webhost to change the PHP Memory Limit to 64M (from 32M) as i was thinking that my drupal installation will automatically detect it...when he responded that he has done it i checked it in status report page it was still showing 32M (my second post).
But after reading your this post i changed in my settings.php file it by adding a line-
ini_set('memory_limit', '64M');
Then i checked my status report page by reloading (already open in one browser window) it and now it was showing me PHP Memory Limit as 64M. Also on clicking PHP version number i see php info which was showing me local value as 64M and master value as 32M.
Now when i pressed the browser back button, i got error 500 : internal server error....now i am not even able to look my home page....i am getting internal server error (500).
Thanks for your response.

---~~~***~~~---
aac

cog.rusty’s picture

I don't think ini_set('memory_limit', '64M') can cause a server error 500. Did you change anything else in settings.php or in .htaccess or did you create any php.ini file?

aac’s picture

Thanks for your response!!
I have not changed anything else. I reported this to my webhost...now it is working fine...but during this issue i reverted my settings.php file to original. So i am still getting the initial error while saving module configurationpage.

---~~~***~~~---
aac

cog.rusty’s picture

Make sure to use a simple text editor which does not insert any markup, just the text.

But it is strange that you could see the admin/reports/status page but not the home page. Did the URL in your browser's address bar look correct when you hit the "back" button. Maybe it was a temporary glitch.

aac’s picture

Thanks for you help!!
I was already logged in as admin on my site as well as on cpanel. I made the changes in settings.php through cpanel and reloaded the status report page. I even tried google to visit my home page but i was getting the internal server error (500). Anyway my webhost has created php.ini file in my root folder and increased the memory limit to 64 M. I have my drupal in a sub directory, so i copied php.ini file in that subdirectory. Now everything is working fine.
Thanks once again!!

---~~~***~~~---
aac

aac’s picture

Hello cog
I would be interested to know one more thing apart from this post issue. Actually i have referred the link (http://drupal.org/node/207036) you have provided before posting my first post. I would like to know how you people provide the link to such post so fast because i have to search it on drupal or google to tell to anybody. It will help me in helping others on this forum. Do you make bookmarks or somthing else??
Thanks!!

---~~~***~~~---
aac

cog.rusty’s picture

Nothing so fancy. This question comes up ten times a day and I know that by googling drupal php memory_limit it will be the first result. Faster than any bookmark that I could keep.

Also a drupal search for php memory_limit will get it somewhere in the first page.

Both faster than navigating to Documentation -> Troubleshoting FAQ -> Webhosting issues -> Increase PHP memory limit.

Stomper’s picture

I am trying to increase my PHP memory limit, I am running Drupal on a localhost. I have done so in the past but it doesn't seem to be working. I have made changes to php.ini, it is the same file referenced in the PHPinfo() provided by the Devel module - "Loaded configuration file"

I have three php.ini's - php.ini, php.ini-dist, and php.ini-recommended. php.ini is the only one referenced in PHPinfo(). Additionally, once I made the change to php.ini, the change was reflected in the other two php.ini variants.

When I run cron, the status report still lists the old value (64M) and not what I changed it to, 128M. Does the fact that I have a "Database updates - out of date" have any effect on why the status report is not reflecting the memory changes? I also have a core update message too.

Another thing, after making the memory change (64M to 128M) I now get a fatal error when trying to empty the cache - "Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 818550 bytes)." It seems to only appear when I try to clear the cache using the Devel module block.

Any suggestions appreciated

cog.rusty’s picture

The three places where you can set the memory limit,

1. php.ini: memory_limit = 128M
2. .htaccess: php_value memory_limit 128M in Drupal's main directory
3. settings.php ini_set('memory_limit', '128M'); under Drupal's sites/default or sites/yoursitename directory.

are processed in that order and the last one has the final word.

In case your only memory_limit setting is in the php.ini file mentioned in phpinfo(), check if the file contains multiple memory_limit lines. If it does, put yours last.

Stomper’s picture

Thanks for the tips but I think I figured it out. I am running a localhost (XAMPP), after I shutdown the XAMPP server and then restarted it and checked the status report, the memory changes had been made and displayed correctly.

So basically the solution was to shutdown the server and restart it to make the changes take effect.

Thanks again

vm’s picture

apache should always be restarted for changes to be picked up