Fix: Fatal error: Allowed memory size – Increase PHP Memory

If you are working with WordPress site then you had faced this issue many time. This is common issue of WordPress. Sometimes any piece of code takes enough time to execute and due to this WordPress requires more memory than allocated .

Here in this article, I am suggesting you some of solution which work perfectly to resolve this Fatal Error.

Solution 1: Using WordPress function in wp-config.php

Open your wp-config.php file located in Root of your WordPress directory using FTP or cPanel.

After that you have to add this code in bottom of your wp-config.php file.

/* Increase memory limit to 1024 MB */
define('WP_MEMORY_LIMIT', '1024M');


Solution 2: Add memory limit in your php.ini

In this solution, You can add PHP function in your php.ini to increase Memory limit. First you find out whether php.ini is located in your /public_html/ folder or WordPress root folder.

In case there is no such file then You can create a file and named it php.ini  inside your /public_html/ folder using FTP or cPanel.

After that add this code to top part of your php.ini file.

//Increase momory limit to 1024MB
memory_limit = 1024M

Now you save this file and refresh your web page where you faced FATAL ERROR.


Note: If you are still get same issue after applying above solution that means your Server Provider  do not give you permission to increase Memory Limit manually. You have to talk to their Support team for further assistance .

By Ashutosh Pratap

I am software developer by profession and doing work and research in field of Computer programmings like PHP, WordPress, Magento, jQuery, Google APIs and many more web languages. Apart from this I write blogs on programming languages like PHP, Javascript, WordPress etc. I am also individual and independent Freelancer so you can hire me for your web work.

Leave a comment

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