Sometimes, you may come across issues such as errors when exporting a large number of entries or errors stating the available memory has been exhausted. These errors are caused by PHP limits within the server and or the WordPress install being too low for the amount of data being processed.
In this article, we will show you how to fix errors related to your PHP memory limits.
In most cases, you will need to modify the PHP memory limit within WordPress as well as your server’s PHP memory limit. As increasing only one may be limited by the other.
To address memory limit issues, there are two paths:
- Adjust yourself
- Contact your hosting company
To adjust on your own, here are some methods to try. Be aware that this section requires advanced knowledge; it is not basic.
Edit your wp-config.php file in the root directory of the WordPres directory.
Add this to the top, before the line that says, ‘Happy Blogging’:
You can change this to anything you want to. In the above example, we have simply set PHP scripts to be able to use 256M you can set it to 4086M which equals 4GB memory which is far more than should be required.
WordPress memory can be different from the server, you need to set this regardless of server memory settings
Edit your PHP.ini file
If you have access to your PHP.ini file, change the line in PHP.ini
If your line shows 64M try 256M:
memory_limit = 256M ; Maximum amount of memory a script may consume (64MB)
Edit your .htaccess file
If you don’t have access to the PHP.ini try adding to an .htaccess file:
php_value memory_limit 256M
Contact Your Host
This is the simplest option if you are not comfortable changing the above files. A good hosting company will be able to assist you quickly and happily. It is also good to know they have your back when your website fails. Simply request them to increase your memory limit on WordPress.
Are you happy with your current hosting company ?
Talk to us if you are thinking of changing!
We can offer the following for $30 / month
- 10GB SSD Storage
- Unlimited Data Transfer
- Daily Backups (30 Day Retention)
- Always-On DDoS Protection
- Australian Data Centre
- 24/7 Premium Phone/Ticket/Email Support