Increase PHP memory limit (4 methods)
While Drupal core will run with 8 MB of memory configured for your server, you may need to increase this depending on how may modules you use on your site.
In Drupal 4.7.x and earlier, when you go into ?q=admin/modules, you may experience a blank screen. This is caused by Drupal loading all the modules of your site into memory, whether you have them turned on or not. If you get a blank screen here, you have two choices; increase your allocated memory for PHP or delete unused modules.
In Drupal 5.x and above, this problem has been fixed, and the modules page no longer loads all modules. If you are still getting out of memory problems, you should either reduce the number of modules used or increase your allocated memory for PHP.
Depending on your host, this can be done in a number of places with the most likely being php.ini or .htaccess depending on your hosting situation.
Add for example:
memory_limit = 16Mto your php.ini file (recommended, if you have access)ini_set('memory_limit', '16M');to your sites/default/settings.php filephp_value memory_limit 16Mto your .htaccess file in the Drupal root- Or simply install: http://drupal.org/project/drupal_tweaks and increase your PHP memory limit in settings.
With root access, you can use the sed util in Linux/Unix based systems, in order to increace the memory for 64M. Don't forget to properly locate you php.ini file!
sed -i 's/memory_limit = 16M/memory_limit = 64M/' /etc/php5/apache2/php.iniYou will need to experiment with the value that is right for you depending on which modules you are using. Some people find they need to set the memory to 24M or 32MB or higher (e.g. 96MB is recommended for a site with built-in image processing using ImageAPI GD).
NOTE: Some hosts do not allow you to control how much PHP memory is available. In this case you will need to work with your host, be very conservative with your module selection and testing or look for a new host that allows more flexibility.
