Skip to Content

Fatal error: Allowed memory size of 16777216 bytes exhausted

15
Sep 2009

After installing the admin_menu module I got a fatal error msg

"Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 319449 bytes) in /var/www/drupal-6.13/includes/database.mysqli.inc on line 303"

 

To rectify the error on the localhost it's possible by increasing the memory_limit = 16M in the php.ini to 32M

(or)
In case of shared hosting, providers who 'll let you set the php values via .htaccess but won't let you edit the php.ini file.

in the .htaccess file add the following line
php_value memory_limit 32M

(or)

add
ini_set('memory_limit', '20M');  or larger to your site's setting.php
under /sites/drupalxxx/settings.php
 

Also have a look at this