WordPress is written in PHP, a server-side programming language. Servers need sufficient memory to run multiple applications at the same time and will allocate specific memory size to different applications, including PHP. Unfortunately, many low budget and shared servers provide minimal default amounts which may not work for growing website.
When your site requires more memory than the allocated memory, you may see this error:
WordPress automatically tries to increase the PHP memory limit if it is less than 64MB. However, 64MB is often not high enough. If this happens to you, don’t worry! I’ve found this solution to be the most effective:
Open your cPanel, then scroll down to the Software section. Click on Select PHP Version.
When it opens, check your PHP version. If 5.4 is set as the current version, you’ll want to select another since, by default, only 64M of memory will be allocated. Additionally, there may be code within your website that will not support PHP version 7.0, so I’d suggest starting with 5.6. Click on Set as current then click Save.
Once you’ve completed this step, click on Switch To PHP Options on the right of the screen.
When it opens, find the memory_limit line item, then click on it’s value on the right to change it to the limit you want. Once you’ve made your selection, click Save at the bottom. You may also choose to change the value for upload_max_filesize if you find it’s value is also too low.