As a WordPress user, you may encounter the “WordPress Memory Exhausted” error message at some point. This error is caused when your WordPress website’s memory limit is exceeded, which can cause your website to become unresponsive or crash. This can be a frustrating issue, but fortunately, there are several steps you can take to fix it. In this article, we’ll provide you with a beginner’s guide and an advanced level solution on how to fix the WordPress memory exhausted error by increasing PHP memory limit.
Beginner’s Guide:
Step 1: Identify the Cause of the Error The first step in fixing the WordPress memory exhausted error is to identify the cause of the error. This can be done by checking your website’s error logs. To do this, log in to your WordPress dashboard, navigate to the “WP-Config.php” file and add the following code: define( ‘WP_DEBUG’, true ); define( ‘WP_DEBUG_LOG’, true ); define( ‘WP_DEBUG_DISPLAY’, false ); This will enable WordPress debug mode and create an error log file in your website’s “wp-content” directory.
Step 2: Increase PHP Memory Limit via wp-config.php Once you have identified the cause of the error, you can increase your PHP memory limit by editing the “wp-config.php” file. To do this, add the following code to the file: define( ‘WP_MEMORY_LIMIT’, ‘256M’ ); This will increase your PHP memory limit to 256MB. If you still experience the error, you can increase the limit further.
Advanced Level Solution:
Step 1: Check Your Server’s PHP Configuration The advanced level solution involves checking your server’s PHP configuration. To do this, create a new PHP file and add the following code:
<?php phpinfo(); ?>
Save the file and upload it to your server. Then, access the file through your web browser. This will display your server’s PHP configuration.
Step 2: Increase PHP Memory Limit via php.ini Once you have identified your server’s PHP configuration, you can increase your PHP memory limit by editing the “php.ini” file. To do this, locate the “memory_limit” parameter and increase its value to your desired limit.
Step 3: Increase PHP Memory Limit via .htaccess If you do not have access to the “php.ini” file, you can increase your PHP memory limit via the “.htaccess” file. To do this, add the following code to the file: php_value memory_limit 256M This will increase your PHP memory limit to 256MB.
WordPress memory exhausted error can be a frustrating issue, but it can be fixed by increasing your PHP memory limit. Whether you are a beginner or an advanced user, there are several solutions available to fix this issue. By following the steps outlined in this guide, you can easily resolve the WordPress memory exhausted error and ensure that your website runs smoothly.