Guys, I came across this error message recently when I tried to install a WordPress Plugin that required to upload a larger database in order to function. As the WordPress plugin installation proceeded, this error message appeared:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 24 bytes)
I googled and looked up different forums like the one of my provider Bluehost, the WordPress Support Forum, and the forum at XML Sitemaps. To make all the info more accessible, I compiled a brief guide on how to solve this fatal error message.
1. Why do I get this error message?
Drupal, a software package for content distribution, automatically sets a PHP memory limit of 16MB (32MB is recommended for Drupal 6). If your application needs more memory, follow the next steps to increase the PHP memory limit from 16MB up to 100MB.
2. Increase PHP Memory via php.ini
Making changes to the php.ini will affect all websites and PHP scripts on the server. Open the php.ini and find the following line in the code:
memory_limit = 32M ; Maximum amount of memory a script may consume (32MB)
You might want to change the “memory_limit = 32M” to either “memory_limit = 64M” or even higher. After saving, reload your web site and the effect should have taken place immediately.
If there is no section already for this, you can place the above line at the end of the file.
3. What if php.ini doesn’t exist on my web server?
If you’re working with Bluehost the php.ini file probably won’t exist from the start. To create the file, follow these steps:
- Go to the cPanel and find Software / Services, select PHP Config
- Select the “Install Php.Ini Master File” button to create a file called “php.ini.default” in your public_html folder
- Select the “PHP5 (Single php.ini) to use” option
- Hit “Save Changes”
- Go back to the cPanel, open the File Manager and click on the public_html folder
- Find the “php.ini.default” file and rename the file to “php.ini”
- Click on “Edit” and find this entry:
memory_limit = 32M
- Change the 32M to 64M or higher
- Hit “Save Changes”
4. Increase PHP Memory via .htaccess
Locate the .htaccess file in the root directory and find these lines:
# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.
Right after these two lines, insert
php_value memory_limit 32M
5. Increase PHP Memory via settings.php
With Drupal installed, you can easily edit the settings.php in sites/default. Find the PHP Settings section in the file and add this line at the end of the section:
ini_set('memory_limit', '32M');
You’re all set. These ways all worked great for me, if you have any suggestions get back to me!

Comments on this entry are closed.