Forums

Out of Memory - Line 791 of WP-DB.php (mysql_real_escape_string) (3 posts)

  1. alistek
    Member
    Posted 12 months ago #

    Hello,

    I am encountering an error with a recently launched site that although the pages display, I am severely limited by the number of plugin's that I can enable.

    We started to see an error occur:

    Fatal error: Out of memory (allocated 24903680) (tried to allocate 1802297 bytes) in /home/normal/public_html/normalpl.org/wp-includes/wp-db.php on line 791
    Now we have tried the usual fixes of increasing PHP and WordPress memory allocations (have a VPS, with full root) all the way up to 256MB but with no affect on the error.

    The following are the plugins enabled:

    • CMS Tree Page View
    • WP-DBManager
    • Login Lockdown
    • Contact Form 7

    Now enabling any other plugins will start to cause these memory errors to occur. Almost always on Post/Page save operations. Notably, All in One SEO or Yoast SEO or W3 Total Cache, but others will also cause this to occur.

    I noticed that in the database there were some strange Unicode Code Points that had been brought in by a cut/paste from Word and so I went through all of the Posts/Pages and escaped all of the entities so that they were not unicode but HTML Entities.

    Unfortunately, the error was still occurring upon enabling one of the above plugins and saving a post/page.

    I wiped out all files/configurations and started with a fresh install of WordPress and re-imported the existing database to make sure there wasn't something strange in the files and I still encountered the issue.

    I feel that I am stuck on thinking that there is some strange escaping bug going on when it hits that mysql_real_escape_string function as removing that and just dumping the plain string into the database works (but is horrible for XSS and proper MySQL escaping).

    In addition, the error happens when using the older method of Add_Slashes, and I also noticed that Magic_Quotes_GPC is on if that helps. Thanks for all of the assistance, this is a baffling one for me.

    -Adam

  2. esmi
    Theme Diva & Forum Moderator
    Posted 12 months ago #

    Try increasing the memory available to PHP:
    http://wordpress.org/support/topic/253495#post-1017842

  3. alistek
    Member
    Posted 12 months ago #

    Thank you, unfortunately I did that for PHP, stepped up in 32MB increments all the way to 256MB and also set the WP Memory Limit but the same issue cropped up. Memory for the overall WordPress installation doesn't seem to be the limiting factor at least for this specific issue.

    -Adam

Reply

You must log in to post.

About this Topic