If you are facing a PHP memory limit error, then don’t worry. In this article, I will discuss, how you can increase the PHP memory limit without any complicated steps. Even, You can change it in a few simple steps in WordPress. There are multiple ways to change the memory limit but in this article, I will discuss only one method to do it.
WordPress is a very popular and preferred content management system. To run every website on WordPress, you need to have PHP memory. You use plugins, themes, images, and other content on your site. And all these require memory to run.
At some point, you may exhaust your PHP memory limit and you may face a memory limit error. It most common error in WordPress sites. And it will depend on how much memory you have and how much you have used.
If you have exhausted your memory, you may face an error. And in that case, you need to increase the PHP memory limit.
Let’s understand how you can do it.
Increase the PHP Memory Limit
First, you should know what is the current memory limit of your website. You can check it from the Cpanel and as well as Site Health also.
What is Site Health in WordPress? Check Health Status & Info
How to Check PHP memory Limit from WordPress Dashboard?
As I above said that there are multiple ways to increase the PHP memory limit of your website. However, here I will discuss, how you can change it through wp-config.php. You can do it in the following steps.
- First of all, you log in to your Cpanel.
- Open the File Manager.
- Do double-click on the Public.html file.
- Select the wp-config.php file by doing a single click.
- Do right-click and click on edit.
- Now find a code like in the below image.
You may have another number instead of 256M. Now you can set the figure as per your choice. However, you can do it up to the maximum memory limit allocated to you by your host.
Increase the PHP memory limit in the wp-config.php file and save your file. If your site is brand new, you might not have the same code in your file. So in that case, you can add the above code.
But before you start the process to change the limit, you should always take a backup of your site. So, In case, something goes wrong, you can restore your site.
In this way, you can increase your PHP memory limit on your WordPress site. In case, this method doesn’t work for you, you may try another suitable method for you. But in case you face this error after that also, you should contact your host provider.
How to Add PDF File in WordPress? Quick & Easy Process
How to Add Private Posts in WordPress?
Mostly you get a PHP memory limit error when you exhausted it. And nothing to worry about it. You can setup it up with new limit with few simple steps. However, it is important that you know the limit given by your server and you know your maximum PHP limit also. So that you can change the new PHP memory limit according. WordPress is a very popular and worldwide used open-source content management system and it so popular. If you face any problem related to WordPress, you may Google or watch a video on platforms like YouTube to find a suitable video that can resolve your problem. And probably there is high chance that you will get the solution if face any.