The ‘WordPress Memory Limit Exhausted’ error or ‘PHP Fatal error: Allowed memory size exhausted’ error in PHP occurs when a script uses more memory than the limit set for it. This can lead to webpage issues like 500 errors, broken functionality, etc. You will find the error message in your server’s log, and it will mention the script and line causing the problem.
In this guide, we will show you how to solve this error while using xCloud. Before that, let’s learn what the PHP Memory Limit is.
What Is The PHP Memory Limit? #
The PHP memory limit is a setting that determines the maximum amount of memory a script can use. It helps prevent poorly written scripts from consuming all available server memory. In xCloud, the maximum memory limit is 2048 MB.
How Much Should You Increase It? #
When increasing the PHP memory limit, it is advisable to raise it enough to resolve the specific error without setting an excessively high value. If it goes beyond 512MB, it might indicate an underlying problem in your code or a plugin. It is important to address these issues directly rather than relying on a high memory limit. Setting an overly high limit can lead to performance problems across all sites on the server, as poorly written code could consume all available RAM. Additionally, it might obscure potential future code issues. Therefore, it is recommended to find the root cause and optimize your code rather than relying solely on an elevated memory limit.
How To Solve The ‘WordPress Memory Limit Exhausted’ Error in xCloud? #
To fix this, you can either increase the memory limit in your PHP configuration or optimize the script to use less memory. It is a straightforward solution to ensure your website functions smoothly. Have a look below.
Check xCloud Storage #
From your xCloud dashboard, go to the ‘Monitoring’ tab. You can see the ‘Ram’, ‘Hard Disk Usage’ and ‘CPU Usage’ from the ‘Server Health‘ section.
Increase The Memory Limit #
From your xCloud dashboard, go to the ‘PHP setting’. Now check the ‘Memory Limit’ and increase it as needed.
That is how easily you can solve the ‘WordPress Memory Limit Exhausted’ error.
Still stuck? Contact our support team for any of your queries.