Hi,

I am having an issue increasing my PHP memory limit.

On the modules page, i get the following error (or similar):

Fatal error: Out of memory (allocated 34078720) (tried to allocate 932012 bytes) in /home/sites/almostadoctor.co.uk/public_html/includes/database.mysql-common.inc on line 41

this would imply that my PHP limit is around 32MB.

I have taken steps to try and increase this, editing the php5.ini, php.ini and the .htaccess file, as well as settings.php (after many attempts, beofre i turned on error reporting, i kept increasing the limit, until now i have reach 512M).

Using phpinfo() i can see that the new limit of 512M does appear to have taken effect, however i still get the error message described above.

Is there anything else i need to do? This has been bugging me for days.

Thanks

Comments

qasimzee’s picture

One work around can be to find the module that is causing the memory error. Do you know what is the last module you installed?

Remove all modules from the sites/all/modules and try to access the modules page, then add one by one to check which module is causing error

--
Qasim Zeeshan
http://qasimzeeshan.com

gnarlytom’s picture

Hi,

thanks for the quick reply. I think it is the notifications module thats causing the rorr, but i'm hoping for a long-term solution, as i now have moderators for my forum that require this module, and I'm hoping to add more modules soon

qasimzee’s picture

gnarlytom’s picture

Thanks guys for your help, but i'm not really looking for a work around for notifications. Just a plain and simple out of memory problem, and i need more memory!

Whats strange is that the phpinfo() is telling me my changes have worked, but drupal just isn't recognising them.

below are the relevant sections of my files,. Maybe i have done something wrong...

The entire contents of php5.ini

memory_limit = 128M
pcre.backtrack_limit = 1000000
allow_url_fopen = 1
allow_url_include = 1

The relevant section of .htaccess

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
  php_value memory_limit 128M
</IfModule>

The relevent section of settings.php:

/**
 * PHP settings:
 *
 * To see what PHP settings are possible, including whether they can
 * be set at runtime (ie., when ini_set() occurs), read the PHP
 * documentation at http://www.php.net/manual/en/ini.php#ini.list
 * and take a look at the .htaccess file to see which non-runtime
 * settings are used there. Settings defined here should not be
 * duplicated there so as to avoid conflict issues.
 */
ini_set('arg_separator.output',     '&amp;');
ini_set('magic_quotes_runtime',     0);
ini_set('magic_quotes_sybase',      0);
ini_set('session.cache_expire',     200000);
ini_set('session.cache_limiter',    'none');
ini_set('session.cookie_lifetime',  2000000);
ini_set('session.gc_maxlifetime',   200000);
ini_set('session.save_handler',     'user');
ini_set('session.use_only_cookies', 1);
ini_set('session.use_trans_sid',    0);
ini_set('url_rewriter.tags',        '');
ini_set('memory_limit',             '128M');

on my ftp, the locations of the files are:

/public_html/php5.ini
/public.html/.htaccess
/public.html/sites/default/settings.php

gnarlytom’s picture

I fixed this issue with adding the following line to my .htaccess

RLimitMem 128000000

easy as that!