How to : Increase PHP memory limit in WordPress.

Hello!
Hope everyone doing well this days. Today I am here with a common issue most of the WordPress Developer/User faced, fix of PHP memory limit issue for WordPress. Sometimes when I am installing theme or plugin in WordPress I get the following error notice,

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in...

I believe many of you also get this kind of error notice. So how can we fix this issue? Generally if you have the access to edit php.ini then you can increase the memory_limit value such as memory_limit = 64M or more but if you dont have the access of edit php.ini then you need to do the following.

Open your wp-config.php file and add the following line,
define('WP_MEMORY_LIMIT', '64M');
With the above code we are increasing the memory_limit value in runtime. But if you still getting the same Fatal error with the value of 33554432 it means your hosting provider disallow to increase memory_limit from PHP runtime. Then you need to contact with your hosting provider so that they can increase the memory limit from php.ini
But if you get Fata error with the value of 67108864 it means you memory_limit is increased but the script needs more memory. So you can change the 64M to 128M or more.

I hope this article helps you to fix the issue. Wish you a happy coding 🙂

(Visited 98 times, 1 visits today)

Leave a comment

Your email address will not be published. Required fields are marked *