Fatal error: Allowed memory size of 41943040 bytes exhausted

Fatal error: Allowed memory size of 41943040 bytes exhausted

Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes) in /home/deltabpo/public_html/wp-admin/includes/post.php on line 602

There has been a critical error on this website. Please check your site admin email inbox for instructions.

Learn more about troubleshooting WordPress.

How to Increase PHP Memory Limit

To increase the PHP memory limit, you need to manually set a new memory limit for your server. This involves editing the wp-config.php file located in the server.

You can use two methods to access the WordPress files in your server. You can either use the File Manager in CPanel or use an FTP client app. For the demonstration, we’ll show you how to do it using the File Manager.

Step 1: Login to your CPanel by typing /cpanel at the end of your domain name (eg: yourwebsite.com/cpanel) use the login details you received from your web host in the welcome email to login to CPanel.

Step 2: Open the File Manager and locate the Public.html folder

Step 3: Find the wp-config.php file then right-click and choose Edit.

Step 4: Search for the line that says “That’s all, stop editing and paste the following code right above it.

define( ‘WP_MEMORY_LIMIT’, ‘256M’ );

This sets your default PHP memory limit to 256MB.

Step 5: Click Save to save the changes. Go back to your website and reload to see if it fixes the error.

Also refer Common WordPress Errors for the most common WordPress errors experienced by WordPress users such as

  1. The White Screen
  2. Internal Server Error
  3. Error Establishing Database Connection
  4. Failed Auto-Upgrade
  5. Connection Timed Out
  6. Maintenance Mode Following Upgrade
  7. PHP errors or MySQL DB errors