0

I work with a few local websites, but some time ago one of them started causing these errors when I try to use it. I couldn't find time for it and left it, so I can't tell what change started causing this.

This is the problem signature:

  Problem Event Name:   APPCRASH
  Application Name: httpd.exe
  Application Version:  2.4.12.0
  Application Timestamp:    54c90386
  Fault Module Name:    php5ts.dll
  Fault Module Version: 5.6.8.0
  Fault Module Timestamp:   552ee66a
  Exception Code:   c0000005
  Exception Offset: 0002a796
  OS Version:   6.3.9600.2.0.0.256.48
  Locale ID:    1033
  Additional Information 1: 5861
  Additional Information 2: 5861822e1919d7c014bbb064c64908b2
  Additional Information 3: 1318
  Additional Information 4: 13181ae637ac2592fac0ca2dd662cdcc

It does not appear on the home page, but appears and prevents page load when viewing user profiles, also appears when viewing a single post. Only the header manages to load and it only shows this message:

Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 36 bytes) in D:\xampp\htdocs\mywebsite\wp-includes\functions.php on line 3374

This is the relevant part of functions.php (I have added a comment behind line 3374)

function wp_list_pluck( $list, $field, $index_key = null ) {
    if ( ! $index_key ) {
        /*
         * This is simple. Could at some point wrap array_column()
         * if we knew we had an array of arrays.
         */
        foreach ( $list as $key => $value ) { /* THIS IS LINE 3374 */
            if ( is_object( $value ) ) {
                $list[ $key ] = $value->$field;
            } else {
                $list[ $key ] = $value[ $field ];
            }
        }
        return $list;
    }

    /*
     * When index_key is not set for a particular item, push the value
     * to the end of the stack. This is how array_column() behaves.
     */
    $newlist = array();
    foreach ( $list as $value ) {
        if ( is_object( $value ) ) {
            if ( isset( $value->$index_key ) ) {
                $newlist[ $value->$index_key ] = $value->$field;
            } else {
                $newlist[] = $value->$field;
            }
        } else {
            if ( isset( $value[ $index_key ] ) ) {
                $newlist[ $value[ $index_key ] ] = $value[ $field ];
            } else {
                $newlist[] = $value[ $field ];
            }
        }
    }

    return $newlist;
}

Does anyone know what causes that error or how to fix it? Thanks in advance.

  • 1
    I just added.. ini_set("memory_limit","64M"); at top of wp-config.php – Vasim Shaikh Feb 12 '16 at 16:37
  • @VasimVanzara I added it too, the error stopped appearing, then I noticed I also had define('WP_MEMORY_LIMIT', '64M'); at the end. Then I removed ini_set("memory_limit","64M"); and the error still doesn't show. Aren't these two lines supposed to do the same thing? – Nadroev Feb 12 '16 at 16:47
  • are working with which server?xampp?? – Vasim Shaikh Feb 12 '16 at 16:51
  • @VasimVanzara Yes, on the fatal error message it shows I am using xampp. This problem appeared for at least a month, now I only added ini_set("memory_limit","64M"); to wp-config.php and then removed it. I didn't even restart apache. I literally did nothing and it stopped appearing. – Nadroev Feb 12 '16 at 16:54
  • you mean it does not start xampp – Vasim Shaikh Feb 12 '16 at 17:00
1

First open your wp-config.php which is located in the root WordPress directory. Then add the following line inside the main php tag:

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

We just increased the memory limit to 64M. If you still get the error after this fix, then please contact your host. Most likely, they would have to go in their php.ini file to increase the memory limit for you.

If you are working on xampp then edit php.ini .Search “memory_limit” in your php.ini, and change the value of it. If no “memory_limit” found, add the following line at the end of php.ini

 memory_limit = 128M ; /* Change the 128M to your needs */
  • Save file.Restart Apache.

Note:You can find xampp/php/php.ini

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.