How to remove memory limit errors in wordpress?
The PHP memory problem is a very common problem in the latest versions of WordPress. I really don’t know what they have done to their code which requires a considerably large amount of memory to run the wordpress error free as compared to the it’s old version.
If you are on a shared hosting environment than it will be the most likely cause for this problem. Most of the shared hosting out there use 32MB as the memory limit, which is of course quite less to run modern applications like wordpress. The memory limit can be changed very easily by editing the variable in the PHP.INI file. This file in most of the cases can only be edited by the server administrator. So this means they will not give you the access to edit this file as a security measure.
Some of the solutions are given below to tackle this problem:-
- Ask your host- Yes it is one of the easiest and most effective solution. Just ask your host to increase the PHP memory limit to atleast 128 MB for the proper working of the latest PHP based applications including wordpress. If you are on a good and reputed host than i am sure they will do this for you as it is not a very daunting task for them.
- Some of the Hosts give you a options to edit the memory limit via .htaccess file also. Add this line to your . htaccess file php_value_memory_limit 128M. As i had already said that that your host must have AllowOverride On in the httpd config file of their server.
- Other solution to this problem involves the editing of wpconfig.php file in your public_html folder of your web server. Find this line in your wpconfig.php file define(‘WP_MEMORY_LIMIT’ , ’64M’); and replace it with define(‘WP_MEMORY_LIMIT’ , ‘128M’); Most of the times this way will not work but still you can try it if all else fails.