wp-db.php on line 958 error and wp_memory_limit

I got error message when I try to access Stats menu from my dashboard.

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 79 bytes) in /home/hosting/public_html/mydomain.net/wp-includes/wp-db.php on line 958

It seem I have memory limitation and need to reconfigure first some point in my wordpress.

Configure WordPress Memory Limit

Add this line in wp-config.php

define('WP_MEMORY_LIMIT', '64M');

Try again and I have no luck. Still same error.

Move the blog with sub domain in my vps account and set the limit to 384 give me great result.

The problem is 64M already place as highest memory value I can use  as I stand in shared host.

Investigate WordPress database data

wp-db.php related to database and that clue give me hint to phpmyadmin and see the status :

in wp_postmeta I see 32,139 rows and click browse button give me to another suspect

meta_key with value ‘searchTerm’ take many space and since I’ve disable the plugin I decide to delete this data.

Solution

Click SQL in phpmyadmin and issue this command :

delete from wp_postmeta where meta_key=’searchTerm’;

Click GO.

New confirmation window appear, I choose OK.

The result is as follow :

31826 row(s) deleted. ( Query took 0.9189 sec )

Try access stats menu from wordpress dashboard and the picture tell me the result

Success, I can access the stats.

Conclusion

  • wp-db.php is function related to database access.
  • try to explore data in database with phpmyadmin
  • use WP_MEMORY_LIMIT as 1st aid.

See you in other post and stay health!

2 Comments

  1. Thank you so much for posting this – I almost had a heart attack when I tried to log into my most profitable site this morning to see that error. Other people suggested editing htaccess and config which didn’t work. Using your db search method I found a tracking stats plugin that I thought I’d deactivated had a massive db overhead. I emptied the table and the site came back! phew…

    Thanks 🙂

Comments are closed.