Friday, November 15, 2013

Drupal 7 - Fatal error: Allowed memory size of X bytes exhausted

I encountered "Fatal error: Allowed memory size of 64233433 exhausted when I tried to copy an existing Drupal 7 installation to another host. I also go this error when I installed ctools module. After doing the following the problem went away.

Try adding one of the following lines to sites/default/settings.php file

ini_set('memory_limit', '32M');
ini_set('memory_limit', '64M');
ini_set('memory_limit', '128M');
ini_set('memory_limit', '256M');
ini_set('memory_limit', '512M');

Adding the 128M memory limit setting worked for me on shared hosting.

During my research I found other solutions that include adding memory configuration to .htaccess and php.ini files. Adding the suggested memory configurations to those files did nothing. My problem was not solved until I added ini_set('memory_limit', '128M'); to sites/default/settings.php file.

How to install Drupal on 000webhost

How to install Drupal 7 on 000webhost


1. Login to your cpanel and create your database using Mysql and write down your database information.

EXAMPLE:
-------------------------------------------------
$mysql_host = "XXXXX.000webhost.com";
$mysql_database = "a######_DATABASE_NAME";
$mysql_user = "a######_USERNAME";
$mysql_password = "PASSWORD";

NOTE: Later, when you install and are at the database screen, make sure to click advance to enter XXXXX.000webhost.com to database host field

2.  In filemanager, use "archives (zip, tar, tgz, gz)" to upload your Drupal distribution file.

3. In  your browser, got to view your site to begin Drupal 7 installation and configuration.