WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
please update WPCACHEHOME path to something more dynamic (7 posts)

  1. Paul G.
    Member
    Posted 1 year ago #

    Hi,

    We run Worpit.com / WorpDrive backup and we're seeing users who use WP Super Cache, so that when they restore their site, they get PHP include errors because the WPCACHEHOME value is a static value added to the wp-config.

    If you move this site to another server, this value is broken immediately.

    Instead, you could use a relative path, such as:

    define( 'WPCACHEHOME', __FILE__.'/wp-content/plugins/wp-super-cache/' ); //Added by WP-Cache Manager

    Or even better, would be to use the WordPress constant: WP_CONTENT_DIR, or the other WordPress constant ABS_PATH.

    Anything else would do, because hard-coding the path causes problems.

    We would be very grateful if you could update your plugin to support relative paths.

    Many thanks!
    Paul.

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

  2. dwboothe
    Member
    Posted 10 months ago #

    Great post.. I agree they should. I am very new to wordpress and just by moving my files over to a sub-domain I got errors.

    Thanks for the post because I did not know where WPCACHEHOME was defined.

    And again they should make it more dynamic eliminating unwanted issues like the one I encountered..

  3. Nobella67
    Member
    Posted 10 months ago #

    Paul G. I feel like kissing you right now, I've spent the better part of 3 days trying to figure out why my WordPress restore didn't work, and you've pretty much fixed my biggest issue and from there I could work the rest of my errors out!

    So a massive THANK YOU! :)

    I've got one last question for you though, since I'm not a WordPress genius, only a beginner, I was wondering if perhaps you'd know why I'm getting the following error once I'm logged into my site:

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

    Please edit C:\xampp\htdocs\wordpress352/wp-content/advanced-cache.php and make sure the path to C:\xampp\htdocs\wordpress352\wp-config.php/wp-content/plugins/wp-super-cache/wp-cache-phase1.php is correct.

    Any ideas would be great!

  4. Paul G.
    Member
    Posted 10 months ago #

    Is this on a live site, or local site?

  5. Nobella67
    Member
    Posted 10 months ago #

    It's local

  6. Paul G.
    Member
    Posted 10 months ago #

    Okay, it says to edit this file:
    C:\xampp\htdocs\wordpress352/wp-content/advanced-cache.php

    because the path is wrong. It is wrong, because you have "wp-config.php" in there.
    Remove that from:
    C:\xampp\htdocs\wordpress352\wp-config.php/wp-content/plugins/wp-super-cache/wp-cache-phase1.php

    and make it:
    C:\xampp\htdocs\wordpress352/wp-content/plugins/wp-super-cache/wp-cache-phase1.php

    hope that helps.
    Paul.

  7. max_Q
    Member
    Posted 10 months ago #

    Okay, I'd like to add my vote for this. I was just bitten during a server upgrade at my host. WP Super Cache broke because the new server configuration reports the path to WordPress differently from the old, and WPCACHEHOME was hard coded to the old.

    Changing WPCACHEHOME to use ABSPATH worked for me, as in:

    define( 'WPCACHEHOME', ABSPATH . 'wp-content/plugins/wp-super-cache/' ); //Added by WP-Cache Manager

    although WP_CONTENT_DIR did not. It was not seen as a constant by get_wpcachehome(), which saw it as a string and did not expand it. I didn't spend much time on it, once ABSPATH worked.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic