How to Increase PHP Memory Limit Wordpress Site

Table of Contents
How to Increase PHP Memory Limit Wordpress Site

One of the things that you are very likely to face in using wordpress is the Memory Limit problem. This can happen when you add a large number of plugins or update plugins or upgrade wordpress to the latest version. This problem occurs because you have files that exceed the default memory limit provided by your hosting server. Let's read Adding Memory Limit in WordPress to completion.


Tips for Adding Memory Limit in WordPress

Indicators of a memory problem are usually only realized when the following error warning appears:


You can solve this problem in the following ways:

Edit File php.ini

Go to your file manager, either through cPanel or your FTP account. If you have access to the php.ini file then you can directly open the file. But if you don't have access then you can create a new file and upload it to the root directory of your WordPress site.

How to create a new php.ini file is to open notepad, then fill in: memory_limit = 64M then save this file with the name php.ini. Next, upload this file to the root directory of your WordPress site via FTP.


Edit File wp-config.php

The next way is to enter through the wp-config.php file. This php file is a very important and sensitive file so be careful when editing. The wp-config.php file, on the other hand can be more secure. You just need to edit by adding define('WP_MEMORY_LIMIT', '64M'); in your wp-config.php. You can adjust the memory according to your needs, for example 128M, 256M, 512M, and so on if the size is still not optimal.


Edit .htaccess File

You can try this method if the hosting you are using does not provide php features. The method is quite easy, you only need to access via ftp then you will see a file called .htaccess. Next you need to do is add php_value memory_limit 64M in the .htaccess file.


Edit file install.php

The purpose of this edit is to add memory enhancement code. The trick is to open the install.php file in the wp-admin folder then add the following code: ini_set ('memory_limit', '64M'); .


Consultation with Hosting Provider

If you have tried all the methods above and still fail, the last step you should do is contact your hosting provider.