Rinkle Mehta March 26, 2023 Technology

How to set WordPress PHP memory limit in your cPanel?

WordPress is an easy-to-use, secure, and user-friendly platform for making websites. It is the only flexible platform that makes developing and designing websites easier. Moreover, uploading media on WordPress websites is also very much easier with the help of WordPress. Though WordPress is very much user-friendly, still there are a lot of issues that we all face while working on it. For example, while working on WordPress, then we need to set a memory limit, and sometimes it becomes difficult to do so.

When you need to upload things like themes, plugins, or format into your WordPress website, then it causes a memory limit error. Fortunately, there are many ways to resolve the same error while increasing the PHP memory limit of your WordPress website you can do so. Today, here in this post, we will discuss how to set the WordPress PHP memory limit in your cPanel.

Why you are getting a WordPress PHP memory limit error?

Before resolving the same issue, you should have an idea about why you are getting the same issue. When you are getting the issue, then you have to resolve it as soon as possible. You can also focus on some of the steps, that will help you in restricting the same issue. You can also take steps, that will let in reducing the chances of getting the same problem again and again.

The error is very much easy to resolve, and you will not get the same error again and again as you are getting 500 internal server errors. With the help of WordPress uploading and installing on the server becomes very much easier. While you will purchase a website hosting plan, then you will get some space on your website. This space is all used over the content available within your website.

Steps to increase PHP Memory Limit

Now, coming to the major question about all those steps that will help you in increasing the PHP memory limit. So, let’s have a look at the information below:

While you are using the WordPress then it will give you a memory limit of 40MB. But on the other hand, if you are having a WooCommerce website, then you need to increase your memory limit. Here we will increase the memory limit upto 512 MB. But the thing that you must understand that when you are increasing your memory limit, then it will not increase the performance of your website. With the help of the WP_MEMORY_LIMIT you can easily control the memory allocation. With its help you can increase to maximum and decrease to the minimum value.

Define(‘WP_MEMORY_LIMIT’,512M’) 512M is important for you to choose if you are using 1GB hosting space along with you. It happens when you are using a shared hosting platform. While you will set 512M of space, then it will make WordPress to use up to (512MB for php space).

In the WP memory limit, you can check how much limit you have accessed to your WordPress website. For an instance, you may have set to the value of 128M. In the server environment you can easily check for the value that you have given to the overall website. It is the value on which the performance of the website depends upon.

Method 1:

Login to the cPanel of your website. You can access to the MultiPHP INI Editor. You can keep the above settings only if you are using 1GB RAM. Check for the max_execution_time, max_input_time, and max_input_vars.  It must be to 3000, 6000, and 1000. By default your memory_limit settings are to 128M. You should make sure to use the latest PHP version.

if still this method doesn’t work then you should try next method.

Method 2

Move to the directories section of your website and choose wp-config.php. Right click on it and choose edit option. Here you need to search for “/* Add any custom values between this line and the “stop editing” line. */”

and write a code below it which is define

define( 'WP_MEMORY_LIMIT', '96M' ); 
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

and save all the settings.

Now, you need to check whether all the changes are done. To check visit the login panel of your WordPress website. You can check the memory limit and PHP memory limit has been changed.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Recent Posts

Limited Offer

Try YetaHost Today!


Get a 80% discount on the first month.

By signing up, you agree to the Terms of service.