• Resolved mcataldi

    (@mcataldi)


    Hello. I’ve been having this error for days, in fact I previously wrote in the forum, and I marked as solved because I thought I had found the problem for a moment, but I have tried more things and I have found more errors, therefore I have decided to make a new topic.
    I will explain step by step the errors and what I have tried to do.
    On Thursday 08/31 I get up and the web doesn’t work. No plugin or PHP has been updated, nor have any substantial modifications been made to justify it.
    In this forum someone tell me to modify the line define (‘WP_DEBUG’, false); by define(‘WP_DEBUG’, true) and that’s what I did. Then I saw this error message:

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/wp-includes/class-wpdb.php on line 1793

    Ok, so I changed all the values in the lines I’m showing now, first to 256, then to 512, and currently they’re at 1024:

    wp-config:

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

    php.ini:

    memory_limit = 1024M

    (also my max execution time is 3000).

    .htaccess:

    php_value memory_limit 1024M

    I try again, and the error becomes the following:

    Fatal error: Out of memory (allocated 367001600) (tried to allocate 262144 bytes) in /var/www/html/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache.php on line 36
    Fatal error: Out of memory (allocated 367001600) (tried to allocate 262144 bytes) in /var/www/html/wp-includes/class-wp-fatal-error-handler.php on line 35

    Reading the plugin name, I deactivate the plugin by renaming the folder.
    And for about two minutes, the page worked before crashing again. That’s why I thought that was the problem and marked my issue as solved.
    However, after those two minutes, it crashed again and the error hasn’t changed (nor the path it shows; the folder is now called w3-total-cache_old). So, I rename the whole plugins folder to plugins_old, which should disable them all, thinking that maybe another plugin is causing the problem. That’s still the error message. Currently the folder is still called plugins_old.
    The number it shows catches my attention, since the set limit is 1024M and it seems that it can’t accommodate more than 367M. I check the wp-config file, and I think that, since I can’t find the problem, I should take advantage so that the error messages do not appear on the screen, but in the debug file. So I modify these lines:

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );

    Errors keep showing up on the screen and the file was not created. I created it and nothing writes there. That makes me think that maybe for some reason the wp-config file is not being read correctly either.
    At this moment, I don’t know what to do. I never faced something of this type and I need guidance and help. The support of my Cloud Server is a disaster and they only repeat that WordPress is a third party application and I must communicate here, so I have no other help. But being a Cloud Server, I have SSH access to any configuration that needs to be reviewed and edited.
    The WordPress version listed in version.php is

    $wp_version = '6.3.1';

    Please, any help you can give me I thank you from the bottom of my heart.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Don’t just rename the directory, delete it completely. Then delete the file wp-content/advanced-cache.php – this is also used by the plugin. Then in wp-config.php you have to delete the entry

    define('WP_CACHE', true); // Added by W3 Total Cache

    in wp-config.php. This plugin should be completely out of the picture.

    Thread Starter mcataldi

    (@mcataldi)

    Hello! Thanks for the help. I just did the steps you told me and it still shows the same error (on the screen. Not in the debug file).

    Currently, exactly the same error message is displayed when calling up the website. If you have really deleted the plugin, the message should no longer appear in this form. Check whether you are really working on the right hosting.

    Thread Starter mcataldi

    (@mcataldi)

    Yes. I’m working on the correct server, because it’s the only one I have…
    I am attaching a console image where not only should all the plugins be disabled, but I have also deleted the folder (apart from deleting the other files and the line that you have previously indicated)

    I highlight that the error appears on the screen and not in the error file, because in my wp-config it appears

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define ( 'WP_DEBUG_DISPLAY', false );

    and it shouldn’t show up on the screen to begin with.

    Thread Starter mcataldi

    (@mcataldi)

    I write again with an update.
    Following these instructions (link), I have cleaned up the .htaccess file of the entire plugin. And indeed it has stopped showing the error… however, now it only says error 500.
    I have edited the wp-config file again so that it would show the errors on the screen and not in a .log file, since it wasn’t, but it isn’t. It only shows 500 error. I specifically leave that section of the wp-config here to check:

    /**
     * For developers: WordPress debugging mode.
     *
     * Change this to true to enable the display of notices during development.
     * It is strongly recommended that plugin and theme developers use WP_DEBUG
     * in their development environments.
     *
     * For information on other constants that can be used for debugging,
     * visit the documentation.
     *
     * @link https://wordpress.org/support/article/debugging-in-wordpress/
     */
    define( 'WP_DEBUG', true );
    /* Add any custom values between this line and the "stop editing" line. */

    I still don’t know what to do to fix it. I keep all plugins folder as plugins_old so it’s not conflict with some plugin, I think.

    *Since it is no longer the error that I mention in the title, I don’t know if I should keep this topic open, but I haven’t found a solution and I wouldn’t want to open a thousand topics, that’s why I keep it unless they tell me otherwise.

    • This reply was modified 1 year, 2 months ago by mcataldi. Reason: aclaration
    • This reply was modified 1 year, 2 months ago by mcataldi.

    Try do enable debugging as described here: https://wordpress.org/documentation/article/debugging-in-wordpress/

    Or take a look at the error log from the hosting.

    Thread Starter mcataldi

    (@mcataldi)

    Thank you so much! Problem solved. Even with that guide I couldn’t get the debug.log file to be created and written, but I checked on the host errors and got an idea.
    I leave what I found and the solution that worked for me in case someone else has the same problem:
    I found this in my error log.

    PHP Warning: require_once(/var/www/html/wp-config.php): failed to open stream: Permission denied in /var/www/html/wp-load.php on line 50
    PHP Fatal error: require_once(): Failed opening required '/var/www/html/wp-config.php' (include_path='.:/opt/remi/php74/root/usr/share/pear:/opt/remi /php74/root/usr/share/php:/usr/share/pear:/usr/share/php') in /var/www/html/wp-load.php on line 50
    PHP Warning: require_once(/var/www/html/wp-config.php): failed to open stream: Permission denied in /var/www/html/wp-load.php on line 50
    PHP Fatal error: require_once(): Failed opening required '/var/www/html/wp-config.php' (include_path='.:/opt/remi/php74/root/usr/share/pear:/opt/remi /php74/root/usr/share/php:/usr/share/pear:/usr/share/php') in /var/www/html/wp-load.php on line 50


    I checked the permissions. Theoretically they were all fine, but I reconfigured them the same way and the issue was fixed. Except for the wp-content folder, which I had to set to 776 for the media library to work properly.
    Clearly the biggest problem was caused by the W3-Total-Cache plugin, which kept throwing errors even after deleting it until I cleaned it entirely with the link I provided above.
    Thank you very much @threadi for your help! I wouldn’t have been able to fix it without your guidance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Out of memory – nothing I tries works and wp-config doesn’t work well either’ is closed to new replies.