I got this error:

"Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2761 bytes) in /home/gotantan/public_html/rwolfefamily/modules/views/views_cache.inc on line 146"

I found this solution:

http://drupal.org/node/76156
"That indicates that Drupal needed more memory than PHP was allowed to give it.

Increase PHP's memory limit, either by adding:

memory_limit = 12M to your php.ini file (recommended, if you have access)
ini_set('memory_limit', '12M'); in your sites/default/settings.php file
php_value memory_limit 12M in your .htaccess file in the Drupal root
Some hosts allow a PHP.ini in the root of your site.

Depending on the amount of modules you have enabled and their 'impact' on the site you may need to increase the memory_limit even more (sometimes to 30 MB or more). Experiment with what memory value works for your needs.

You may need to restart your server before the php.ini settings take effect."

I changed the memory limit from 32 to 62 in the php.ini, however I did not change any of the other files. Now I get these error messages:

"Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 64 bytes) in /home/gotantan/public_html/rwolfefamily/modules/views/views_cache.inc on line 102

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in /home/gotantan/public_html/rwolfefamily/modules/feedapi/parser_simplepie/simplepie.inc on line 12061

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 145834 bytes) in /home/gotantan/public_html/rwolfefamily/includes/common.inc on line 2188

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 83 bytes) in /home/gotantan/public_html/rwolfefamily/includes/form.inc on line 852"

What should I do now?

Comments

davedelong’s picture

Don't forget to restart the webserver. Otherwise your server won't know you've changed the memory limit.

tasigurl’s picture

According to the techs at my webhost there is no need to restart web server because they use Unix. Still getting the errors. Should I increase the memory?

jadowd’s picture

Your techs are wrong. apache reads the php.ini file on start... not on the fly. Tell them that your change is not in the .php file... but in php.ini itself. If they persist... just tell them to do it to make you happy...

Andy_Read’s picture

I fully agree that Apache needs to be prompted to re-read the config files and restart works, but this can be done with a reload rather than a restart. This avoids any interruption to service. I've just successfully changed the memory limit to 64M and cleared the same error on my debian box with:

/etc/init.d/apache2 reload

(using root login)

Changing the world one drop at a time...

jadowd’s picture

It just occurs to me that they might mean reboot the server... which isn't what we are talking about here. The web server is the application that is serving your site content to the web. They need to stop and start apache, if that is what they are using, I would bet my pinky that it is.

tasigurl’s picture

The Webhost tech upped the php.ini to 100 but nothing changed. Then he enabled fast cgi and now no errors and Drupal is working!

svelasco’s picture

I have de same error and want to change my webhost. Who is your Webhost?
Thank you.

tasigurl’s picture

Bluehost

Jordash’s picture

I had same thing happen, I think enabling the PHP fast CGI in Bluehost Control Panel restarts the server and is a way to get around the problem. Either way change your PHP.ini file and then change to PHP Fast CGI (or back to other mode) and it works on Bluehost.

david_y_johnson’s picture

how to set php_value memory_limit 12M in .htaccess file,can you make an example?

chuckienorton’s picture

Yeah, I tried the example from here - http://drupal.org/node/76156 (php_value memory_limit 64M) and it the whole site went offline. How do you implement that?

Thanks.
ps - I use bluehost too & am having all these same problems.

Maximus284’s picture

I am one of the tech support staff for the bluehost companies and i would like to clarify a few settings on our system.

Your PHP.INI file is the file you need to modify in order to increase your memory limit.

the settings you will need to modify are these:

max_execution_time = 30 ; Maximum execution time of each script, in seconds (set this to something high like 300)

max_input_time = 60 ; Maximum amount of time each script may spend parsing request data (set this to something high like 600)

memory_limit = 10M ; Maximum amount of memory a script may consume (set this to something like 500M)

Then in the php config icon of your account, set your site to the php5 (single php.ini) settings as the Fast CGI is not compatible with some drupal installations. if you find that fast cgi works, great if not, just stay on the php 5 setting.

Also, you do Not need to , and you cannot reboot the server on bluehost. We have a special modification to our server that allows the php.ini files to be initialized on the fly and it does not need to be restarted every time a change is made. Therefore, make the changes in the php.ini and refresh your site a couple of times and the new settings will be applied.

To see if the settings you are making in your account are taking affect, put a phpinfo.php file in your account and use the <? phpinfo(); ?>

Lastly, do not use the php_flag variable in our server. The .htaccess file does not recognize that flag and it will result in your account producing a 500 error, just make your modifications to the php.ini file itself.

If the above memory fix does not solve your problem, there may be a file in the drupal that is limiting your memory usage. (as this line suggests here: "ini_set('memory_limit', '12M'); in your sites/default/settings.php file")

If all the above doesn't work, contact the bluehost support and drupal to see if there are any other fixes to your problem and/or any other files you may need to modify.

Thanks

soccernyc’s picture

I too have a Drupal install on Bluehost and I followed your instructions (checking and double checking) and so far so good. Thanks for helping me do my very FIRST php.ini edit ever! Now if I could just get Mailman to work with my Bluehost account.

WildBill’s picture

From http://drupal.org/node/76156:

Note: Do not just set an arbitrarily high number just to avoid this potential problem - it may limit your ability to have multiple simultaneous connections run efficiently, and simultaneous connections are important on webservers.

gasperd’s picture

I have a bluehost account and just managed to solve the memory allocation problem, thanks to the advice given by maximus. Good to see bluehost on this forum as well.
thanks

skai8’s picture

Thank you Maximus, this was exactly what i needed in order to fix my problem with the php memory limitation.

Additional usefull information was found under the url http://helpdesk.bluehost.com/index.php/kb/article/128 in the knowledgebase from the bluehost helpdesk:

Configuring the PHP Environment With php.ini
Top :: Bluehost Support :
Top :: Bluehost Support : Supported Features / Versions :
Top :: Bluehost Support : Supported Features / Versions : PHP :

Problem:

How do I change the PHP environment for my site with php.ini?

Solution:

To generate a new php.ini file:

1. Login to your cPanel
2. Click on the PHP Config icon located under "Software/Services"
3. Look for the section that says "Install Default php.ini"
4. Click the "INSTALL PHP.INI MASTER FILE" button
5. You will now have a file inside the public_html folder named php.ini.default
6. Use the File Manager or FTP to rename that file to php.ini

If you have any further questions about configuring the php.ini file, there are extensive descriptions within the file itself. You may also find more help at: http://www.php.net/docs.php

To change the type PHP type used for your account:

1. Login to your cPanel
2. Click on the PHP Config icon located under "Software/Services"
3. Select the type of php version you wish to use, click "save changes"

* Standard PHP (Default)

By default all accounts use standard PHP. With standard PHP selected, a php script will use the server's master php.ini configuration file if the script's directory does not contain a php.ini file. Each hosting account initially has a copy of the php.ini file in the public_html directory. You may make any changes to this file and the modification will take precedent over the master file. With standard PHP selected in the cPanel, you will need to copy the modified php.ini file into all subdirectories containing php files which are to use the custom php settings.

Note: Different folders can have different php.ini files containing different php settings. If you need to use different php settings for two different scripts, you can place them each in their own folder and with their own php.ini file.
* PHP Single php.ini

To avoid copying the same php.ini file to each and every directory containing php files, you may select PHP Single php.ini. This option changes the php handler defined in ~/public_html/.htaccess to indicate that all subfolders use the same php.ini found in public_html/.

Note: The .htaccess php handler is recursive through all subdirectories unless a subdirectory has a .htaccess file also defining a php handler.
* PHP FastCGI

Using the PHP FastCGI option makes all your PHP applications run through mod_fcgid instead of mod_suphp. FastCGI uses only one php.ini file located in the public_html directory. For more detailed information about PHP FastCGI including benefits and potential problems, ...

...

Drupal and Bluehost is great!

john.r’s picture

This post by the Bluehost tech guy just fixed my problems with Drupal on Bluehost. I tried something like this previously, but now I got it right. Very Satisfied!!! (And that with their $3.95/month deal for the next three years, super!)

spigot’s picture

I had to set the following to 64M to get it to work, before that I couldn't even save the modules without changing anything without getting the 'Allowed memory...' error message.

settings.php:
ini_set('memory_limit', '64M');

php.ini:
memory_limit = 64M

leewoodman’s picture

the update status module was causing this to trip out for me... Try switching that off

Lee

Juc1’s picture

sub

msachin90@gmail.com’s picture

edit setting.php in site/defaults
and
add
ini_set('memory_limit',"64M");

stevearogge’s picture

I have a dedicated server with Inmotionhosting and followed the steps the BlueHost Tech pointed out and it worked great. Thanks.