Error "Out of memory (allocated 248512512)" in wp-db.php

Asked

Viewed 663 times

1

Does anyone know which error would be related to this wordpress message.

Fatal error: Out of memory (allocated 248512512) (tried to allocate 17498497 bytes) in /backup/public_html/wp-includes/wp-db.php on line 1094

I’m not able to install plugins, activate the ones I have installed and when I try to update some article I also get this message.

On line 1094 there is this code

      /**
 * Real escape, using mysqli_real_escape_string() or mysql_real_escape_string()
 *
 * @see mysqli_real_escape_string()
 * @see mysql_real_escape_string()
 * @since 2.8.0
 * @access private
 *
 * @param  string $string to escape
 * @return string escaped
 */
function _real_escape( $string ) {
    if ( $this->dbh ) {
        if ( $this->use_mysqli ) {
            return mysqli_real_escape_string( $this->dbh, $string );
        } else {
            return mysql_real_escape_string( $string, $this->dbh );
        }
    }

    $class = get_class( $this );
    if ( function_exists( '__' ) ) {
        _doing_it_wrong( $class, sprintf( __( '%s must set a database connection for use with escaping.' ), $class ), E_USER_NOTICE );
    } else {
        _doing_it_wrong( $class, sprintf( '%s must set a database connection for use with escaping.', $class ), E_USER_NOTICE );
    }
    return addslashes( $string );
}
  • Enter part of the code of wp-db.php. apparently he’s executing an instruction that consumes all available memory.

  • How do I fix it? could you help me

  • Which version of wp vc uses?

  • I upgraded to the latest version. since then this error has started to appear

  • 1

    http://answall.com/questions/85642/erro-wordpress-painel-admin-n%C3%a3o-entra#comment172555_85642

  • Friend please do not duplicate the question, You duplicated it twice, this will not help you get the answer faster. If you did not get the answer you want try to edit the question and add more details and always use more intuitive titles. I recommend reading this link: http://meta.pt.stackoverflow.com/a/3969/3635 - Good luck!

Show 1 more comment

1 answer

1

Hello, 256MB is a lot of memory for a script, so if you are exceeding, the first things to check for are some scenarios: An infinite loop that’s drawing its memory limit. Another thing... if you’re pulling data from a database and you’re unintentionally pulling from a table with a lot of data. It may exhaust your memory. Among other things... How to get rid of this message?! Modify your php.ini to increase your memory_limit for something bigger than what you currently have for - 512MB. But this will solve your problem partially, probably in the future you may have another problem like this, so I advise you to try to find out what might be giving you this problem, blz? I hope I helped you. See you around.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.