• Resolved RichTWebGuy

    (@richtwebguy)


    Is it really unavoidable to hard-wire a path in wp-config.php? I have a development environment and move the files to a live hosting platform periodically. Seems like a hard-wired path is not a good technique.

    define( 'WPCACHEHOME', '/tweb/websites/texample.com/www/wp-content/plugins/wp-super-cache/' );
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Paulina H. (a11n)

    (@pehaa)

    Hey @richtwebguy,

    I’ve asked our development for some help on how to accomplish this, when someone has a chance we’ll pass along an update.

    Plugin Contributor Mark (a11n)

    (@thingalon)

    Hi @richtwebguy,

    Super Cache needs to know where its files are before all of WordPress has finished initialising so that it can serve cached content as quickly as possible.

    If it suits your development environment, you can setup wp-config.php to supply different values to WPCACHEHOME based on environment or server variables (e.g.: $_SERVER).

    If you do so, please also set up a filter to tell Super Cache not to override your wp-config.php settings with this code:

    add_filter( 'wpsc_enable_wp_config_edit', '__return_false' );
    Thread Starter RichTWebGuy

    (@richtwebguy)

    Thanks for the info.

    wpsc_enable_wp_config_edit will be a big help. I guess that would go in functions.php?

    Question: maybe there are edge cases where this doesn’t work, but is there a reason that defining WPCACHEHOME as relative to document-root wouldn’t work?

    Or instead of

    define( 'WPCACHEHOME', '/tweb/websites/texample.com/www/wp-content/plugins/wp-super-cache/' );

    using this

    define( 'WPCACHEHOME', __DIR__ . '/wp-content/plugins/wp-super-cache/' );
    Plugin Contributor Mark (a11n)

    (@thingalon)

    Hi again @richtwebguy,

    wpsc_enable_wp_config_edit will be a big help. I guess that would go in functions.php?

    Yes, functions.php would be a fine place to put that.

    Question: maybe there are edge cases where this doesn’t work, but is there a reason that defining WPCACHEHOME as relative to document-root wouldn’t work?

    Using ABSPATH when defining WPCACHEHOME should be fine – just be sure to do it below where ABSPATH is defined in wp-config.php (typically near the bottom).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WPCACHEHOME hard-wired’ is closed to new replies.