WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
Warning! WP Super Cache caching broken! The script advanced-cache.php could not (50 posts)

  1. joycegrace
    Member
    Posted 1 year ago #

    Hello I just tried to instal WP Super Cache and I am getting a weird warning message:

    Warning! WP Super Cache caching broken! The script advanced-cache.php could not load wp-cache-phase1.php.

    Please edit /home/[our-site-folder]/public_html/[wp-content-folder-renamed]/advanced-cache.php and make sure the path to /home/[our-site-folder]/public_html/[wp-content-folder-renamed]/plugins/wp-super-cache/wp-cache-phase1.php is correct.

    The problem is, I've gone into this file, as instructed, and there isn't really a "path" anywhere.

    I just see the file name of "wp-cache-phase1.php" and try to change that to a full path, but that doesn't work.

    I've tried deactivating and re-activating and that also didn't work.

    I've tried looking online for answers and nothing seems to be solving this issue, that I could find.

    Can you help?

    Here is the code that is in /home/[our-site-folder]/public_html/[wp-content-folder-renamed]/advanced-cache.php:

    <?php
    # WP SUPER CACHE 1.2
    function wpcache_broken_message() {
    	if ( false == strpos( $_SERVER[ 'REQUEST_URI' ], 'wp-admin' ) )
    		echo "<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->";
    }
    
    if ( false == defined( 'WPCACHEHOME' ) ) {
    	define( 'ADVANCEDCACHEPROBLEM', 1 );
    } elseif ( !include_once( WPCACHEHOME . 'wp-cache-phase1.php' ) ) {
    	if ( !@is_file( WPCACHEHOME . 'wp-cache-phase1.php' ) ) {
    		define( 'ADVANCEDCACHEPROBLEM', 1 );
    	}
    }
    if ( defined( 'ADVANCEDCACHEPROBLEM' ) )
    	register_shutdown_function( 'wpcache_broken_message' );
    ?>

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. Donncha O Caoimh
    Member
    Plugin Author

    Posted 1 year ago #

    Did you copy the file there manually?

    In the include_once( WPCACHEHOME . 'wp-cache-phase1.php' ) bit change WPCACHEHOME to the path to that file in the wp-super-cache directory.

  3. Abhishek Ghosh
    Member
    Posted 1 year ago #

    Deactivate the plugin and copy paste the wp-cache-phase1.php in proper Linux path > Activate Plugin. If still error throws, uninstall as written (read carefully the guide on plugin page) and then again install via WordPress interface (at http://your-nice-domain.com/wp-admin/plugin-install.php > Search).

  4. hieu.nguyen
    Member
    Posted 1 year ago #

    I have that problem also. Can you point out where the fixed path is located so that I could manually edit it. It's clearly not in wp-content/advanced-cache.php

  5. hieu.nguyen
    Member
    Posted 1 year ago #

    OK I figured that out.

    Go to your wp-config.php (located at WordPress root) and fix the path here:

    define( 'WPCACHEHOME', 'new-path-goes-here' ); //Added by WP-Cache Manager

    This is confusing because of the message :-)
    I had to dig the code to find that out. There are tons of posts asking for this, I will go around and answer all of them ha ha.

  6. expatstudios
    Member
    Posted 1 year ago #

    I am having the same problem. I am new to WordPress and have been troubleshooting this problem for a few days now, but mine maybe slightly different.

    I can install the plugin and activate it. I get the above error message, use Hieu's method to edit the wp-config.php file, then the error message goes away.

    However, when I try to enable the plugin, it starts to generate an advanced-cache.php file, which it should do, but then my Dashboard, NOT site, gets a Http 500 error. If I delete the advanced-cache.php file, Dashboard will reload. Then, whenever another advanced-cache.php file is created, http 500 all over again. Whenever the file is created Dashboard crashes.

    I have tried deactivating the plugin and reactivating it completely using the 3 step method outlined on the plugin homepage. This does not work. W3 Total Cache produces the same results.

    Any idea?

  7. hieu.nguyen
    Member
    Posted 1 year ago #

    Yeah it's weird because the advanced-cache.php can only throw some error strings into the screen. It can't cause 500 server error.

    500 error usually happens when you mis-config something (wp-config.php) or something goes wrong with .htaccess.

    My advice: try to comment out each section in the advanced-cache.php to see which line causes the trouble (very old method of debugging lolz).

  8. expatstudios
    Member
    Posted 1 year ago #

    Well, at a quick glance, my advanced-cache.php appears identical to the one the OP posted. The only thing I think I need in the wp-config.php is: define( 'WP_CACHE', true );, if I've read correctly.

    I did try creating an .htacess file in the /wp-content/cache directory (there wasn't one generated automatically, should there have been?) and pasting some code in there (read it somewhere in plugin's support), but that didn't work so I deleted it. I have never touched the wp-root .htaccess file.

    I haven't tried changing permissions yet, but don't think they're the problem.

  9. hieu.nguyen
    Member
    Posted 1 year ago #

    Yeah, the thing is when you delete that file, it's ok again -> so clearly the file advanced-cache.php has the problem.

  10. expatstudios
    Member
    Posted 1 year ago #

    Ok, so I placed // at the beginning of each line starting from the top and may have something. Dashboard loaded up again after placing // at the beginning of this line:

    "} elseif ( !include_once( WPCACHEHOME . 'wp-cache-phase1.php' ) ) {"

  11. expatstudios
    Member
    Posted 1 year ago #

    This is from the plugin's FAQ:

    18.The error message, "WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed!" appears at the end of every page. Open the file wp-content/advanced-cache.php in your favourite editor. Is the path to wp-cache-phase1.php correct? This file will normally be in wp-content/plugins/wp-super-cache/. If it is not correct the caching engine will not load.

    There is no path in the advanced-cache.php. Should there be one here? (Back to OP problem).

  12. hieu.nguyen
    Member
    Posted 1 year ago #

    Yeah, it's the WPCACHEHOME, that's not defined. That's why I gotta change it in wp-config.php

    However, I cna't understand why you have 500 server problem. May be read your error log file?

  13. expatstudios
    Member
    Posted 1 year ago #

    I just found an advanced-cache.php file in the plugin/wp-super-cache folder. Should the path in the wp-config.php point to this one, or to the advanced-cache.php in the wp-content folder?

  14. hieu.nguyen
    Member
    Posted 1 year ago #

    Here is my code in wp-config
    define( 'WPCACHEHOME', 'PATH/wp-content/plugins/wp-super-cache/' ); //Added by WP-Cache Manager

  15. expatstudios
    Member
    Posted 1 year ago #

    Yes, my code is identical to that. Unfortunately, it's the advanced-cache.php in the wp-content folder that's giving me the problems. I tried deleting the one in the /plugins/wp-super-cache and it did nothing.

    I am not very familiar with error logs. On my shared server, @Bluehost, I choose the one errorlog function I see and refresh it just after I get a 500 error for the first time. However, nothing is showing up on the log that I see refering to my ip address.

  16. jagarner
    Member
    Posted 1 year ago #

    Hieu,

    Thanks ever so much for sharing this, I couldn't figure it out!

    Worked like a treat adding:

    define( 'WPCACHEHOME', 'new-path-goes-here' );

    to the WP wp-config.php file in root

  17. hieu.nguyen
    Member
    Posted 1 year ago #

    You are welcome :-)

  18. leodanrtg
    Member
    Posted 1 year ago #

    Hi Hieu, I had that problem, and I have catched your advise: " Here is my code in wp-config
    define( 'WPCACHEHOME', 'PATH/wp-content/plugins/wp-super-cache/' ); //Added by WP-Cache Manager"

    I changed the root in my folder where my WP cache is reading the data, and It was solved....Thanks

  19. stealingsand
    Member
    Posted 1 year ago #

    I did a clean install, and have agonized for about 4 hours on this today.

    Come to find out, in my wp-config.php file, the line

    define( 'WPCACHEHOME', 'path-on-my-site' );

    was inserted ABOVE
    <?php /**/ ?><?php

    ...which makes it singularly unhelpful.

    I moved it below, above another section of code that looked similar to it (very technical, I am), and voila, now it works. WHEW. Because srsly, I'm not very good at these things.

  20. dsteplight
    Member
    Posted 1 year ago #

    I resolved the problem by writing the below code in my wp-config.php file before ABSPATH is ever defined.

    define('WPCACHEHOME', dirname(__FILE__) . '/wp-content/plugins/wp-super-cache/');

  21. Coolcash4live
    Member
    Posted 1 year ago #

    Please I am new to this coding of a thing...can you please help me @Hieu.

    My site is not caching at all because of this problem.

  22. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    As per the Forum Welcome, please post your own topic. Your problem - despite any similarity in symptoms - is likely to be completely different.

  23. kim@steinhaug.com
    Member
    Posted 1 year ago #

    Well I tried aøø the different ideas here, without any luck. Doesnt help adding "define('WPCACHEHOME', dirname(__FILE__) . '/wp-content/plugins/wp-super-cache/');" in config for me _ i still get:

    Warning! /home/111/public_html/wp-content/advanced-cache.php does not exist or cannot be updated.

    Clearly the path plugins/wp-super-cache/ is missing.

  24. Tanaji
    Member
    Posted 1 year ago #

    Hi,
    Thanks hieu.nguyen for your helpful information. Its work for me. Thanks again.

  25. drew.r.wilson
    Member
    Posted 1 year ago #

    I have a similar problem. Same error ("WPCACHEHOME must be set in config file.")

    If temporarily chmod my wp-config.php to 777, I can get it to go to the next step and add the correct item to the wp-config.php file, but when I chmod wp-config.php back to non-writeable, the same error comes back.

  26. Jesterx93
    Member
    Posted 1 year ago #

    here is what i did .. I found this in the file wp-config.php

    /** Sets up WordPress vars and included files. */
    
    require_once(ABSPATH . 'wp-settings.php');

    then above the line:
    require_once(ABSPATH . 'wp-settings.php');

    I entered a new line:
    define('WPCACHEHOME', dirname(__FILE__) . '/wp-content/plugins/wp-super-cache/');

    so the final product looked like this:

    /** Sets up WordPress vars and included files. */
    define('WPCACHEHOME', dirname(__FILE__) . '/wp-content/plugins/wp-super-cache/');
    require_once(ABSPATH . 'wp-settings.php');

    hope this helps

  27. revixi5
    Member
    Posted 1 year ago #

    To me, the problem is cause by a change (by the hosting company) in the absolute path of the server. By following the instruction in the warning, I solve the problem. No need to touch the wp-config.php file.

    Open the file : /wp-content/advanced-cache.php
    Compare the absolute path written in that file with the one include in the warning message (in WordPress dashboard). The warning message is giving you the new path, use it to fix the one in the advanced-cache.php file.

  28. revixi5
    Member
    Posted 1 year ago #

    UPDATE :
    I found an important detail. The file "advanced-cache.php" that is located OUTSIDE the PLUGINS folder, that is to say in the WP-CONTENT folder is not updated when updating the plugin. So if you are using this plugin for a long time, it is possible that the code in this file differs from the current version (v1.2).

    In older versions (for example v0.8.9.1), the absolute path is written in it directly.

    <?php
    # WP SUPER CACHE 0.8.9.1
    function wpcache_broken_message() {
    	if ( false == strpos( $_SERVER[ 'REQUEST_URI' ], 'wp-admin' ) )
    		echo "<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->";
    }
    
    if ( !include_once( '/YOUR ABSOLUTE PATH/wp-content/plugins/wp-super-cache/' . 'wp-cache-phase1.php' ) ) {
    	if ( !@is_file( '/YOUR ABSOLUTE PATH/wp-content/plugins/wp-super-cache/' . 'wp-cache-phase1.php' ) ) {
    		define( 'ADVANCEDCACHEPROBLEM', 1 );
    		register_shutdown_function( 'wpcache_broken_message' );
    	}
    }
    ?>

    In the new version (v1.2), that file only contains a link to the WordPress "wp-config.php". So it would be better to update the contents of the "advanced-cache.php" found in WP-CONTENT folder with the following:

    <?php
    # WP SUPER CACHE 1.2
    function wpcache_broken_message() {
    	if ( false == strpos( $_SERVER[ 'REQUEST_URI' ], 'wp-admin' ) )
    		echo "<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->";
    }
    
    if ( false == defined( 'WPCACHEHOME' ) ) {
    	define( 'ADVANCEDCACHEPROBLEM', 1 );
    } elseif ( !include_once( WPCACHEHOME . 'wp-cache-phase1.php' ) ) {
    	if ( !@is_file( WPCACHEHOME . 'wp-cache-phase1.php' ) ) {
    		define( 'ADVANCEDCACHEPROBLEM', 1 );
    	}
    }
    if ( defined( 'ADVANCEDCACHEPROBLEM' ) )
    	register_shutdown_function( 'wpcache_broken_message' );
    ?>

    And then you can check your "wp-config.php" file (at the root of WordPress) if it contains the absolute path of your server (the warning message usually contain the old and the new absolute path of your server). The line should be like this (with your absolute path):

    define('WPCACHEHOME', '/YOUR ABSOLUTE PATH/wp-content/plugins/wp-super-cache/' ); //Added by WP-Cache Manager

    Hope this help.

  29. Markszachary
    Member
    Posted 1 year ago #

    My site is down because of WP Super Cache. MY PROBLEM is that I can't even get into wordpress at all to remove the plugin. I have tried all of your ideas and still can't even get into wordpress. The plugin is the absolute worst ever. It has destroyed my website.

  30. revixi5
    Member
    Posted 1 year ago #

    Never heard of a problem that serious with that plugin... Probably in conflict with another plugin. You will have to remove it manually by FTP, or by your host file manager.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic