Solved Allowed memory size of 33554432 bytes exhausted

Solved allowed memory size of 33554432 bytes exhausted wordpress

We solved Allowed memory size of 33554432 bytes exhausted which for wordpress. Given solution for allowed memory. Change given for wordpress/wp-config.php file.

Solved Allowed memory size of 33554432 bytes exhausted

We got always following ERROR PHP Fatal error:

Allowed memory size of 33554432 bytes exhausted (tried to allocate 10485761 bytes)

This issue with old and new wordpress versions both. First you need to increase memory limit for your php package. Use following method for increase the memory for php.

Open php configuration file


# vim /etc/php.ini

Change following sections:

max_execution_time = 300 ; Maximum execution time of each script, in seconds
max_input_time = 300 ; Maximum amount of time each script may spend parsing request data
memory_limit = 128M ; Maximum amount of memory a script may consume (16MB)

After this dont forget to restart apache server.

I know on 2.5.1 i needed to increase the memdory, but i don’t know how in 2.6. in the wp-config.php there no define to increase memory. If you are using old wordpress version less than wordpress 2.6 version or you are using the wordpress MU then use following code. open your wp-settings.php file from root folder and change following line

if ( !defined('WP_MEMORY_LIMIT') )
        define('WP_MEMORY_LIMIT', '32M');
to
if ( !defined('WP_MEMORY_LIMIT') )
        define('WP_MEMORY_LIMIT', '128M');

If you are using the newer wordpress version greater than 2.7 then use following method. Following URL is also helpful http://codex.wordpress.org/Editing_wp-config.php

#Increasing_memory_allocated_to_PHP Edit wp-config.php and enter the following line


define('WP_MEMORY_LIMIT', '64M');

If you are using the shared hosting then use following method.

  •  Create a file called php.ini in the root of your site (if you are using a hosted addon domain, this must be in the subdirectory of that site)
  • In php.ini, enter a line that says memory_limit = 64MB 3. In your site’s .htaccess (being a WordPress blog, I’m assuming there is one), enter the following line SetEnv PHPRC // (keep the slashes)
  • Edit wp-config.php and enter the following line

define('WP_MEMORY_LIMIT', '64M');

  • Upload the new files to the server Oh, and don’t tell your hosting provider you’ve done this… This will solve your issue.
Solved Allowed memory size of 33554432 bytes exhausted
Solved Allowed memory size of 33554432 bytes exhausted

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.