Is your wordpress two slow? did you get an error that display not enough memory to run current script?did you get error like this one?
Fatal error: Allowed memory size of 8388608 bytes exhausted.
or PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 6233929 bytes) in /home/…/press/wp-includes/cache.php on line 330
or Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 368640 bytes) in /wordpress/wp-includes/class-simplepie.php on line 9575
Then you are lucky to be here! Here are four solution to increase your WordPress memory
- If you have access to your PHP.ini file, change the line in PHP.iniIf your line shows 32M try 64M or even 128M:
memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)
- If you don’t have access to PHP.ini try adding this to an .htaccess file:
php_value memory_limit 64M
- Try adding this line to your wp-config.php file:Increasing memory allocated to PHP
- Talk to your host!
Update: Monitor real WordPress memory usage:
do you know how much memory your WordPress needed? how much is your pick WordPress memory usage?
If all need memory for your wordpress is 10M. Why you should be worry to set it to 64M? Thats true I found My pick memory usage was just 8M! That is why wordpress default memory usage is only 32M which is more than enough.
Here are two plugin that let you to monitor and know your WordPress current and pick memory usage.
try them before changing your WordPress memory usage to higher value.
Simple and light. Show up the PHP version, memory limit and current memory usage in the dashboard and admin footer. You can now simple measure the requirements of your plugins and language files
More advanced with more report. view the current and peak memory usage of the application. This is extremely helpful when testing new plugins, or if there are a lot of modifications, plugins, or large language files. As of version 0.4, administrators now have the ability to view detailed system information about their web server, MySQL, PHP, and WordPress software. (Requires PHP5)
Note: If you add define(‘WP_MEMORY_LIMIT’, ’64M’); to the end of WP-config.php it do not work. You have to add it to at top of wp-config.php file (at root of your wordpress directory). here is the final result:
As you see in above screen-shot, My WordPress Memory limit is set to 64M which is more than enough.
If you are wonder what are rest of the extra gray lines , continue reading simple ways to make youe wordpress faster
Try same yourself. In nutshell you need to do following steps:
- Check your current memory by using above plugins
- set php.ini memory to higher if needed.
- Set WordPress Memory to a value equal or less that php.ini memory
- Check your change is working or not ( by using above plugins)
If still you had difficulty let me know to help you.
Do you need Professional coder? Hire me
Looking for different WordPress plugin? Try Wishlist member
Andy is one of core WordPress WishList Member Developer. He is in love with WordPress and fun of turning new ideas to WordPress plugin or theme.
Use this, for example, if scheduled posts are not getting published.
According to Otto's forum explanation, "this alternate method uses a redirection approach, which makes the users browser get a redirect when the cron needs to run, so that they come back to the site immediately while cron continues to run in the connection they just dropped. This method is a bit iffy sometimes, which is why it's not the default."