WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
WPCACHEHOME error when wordpress is in own folder (5 posts)

  1. alastc
    Member
    Posted 3 years ago #

    Hi,

    I run one wordpress folder for a few sites (under completely different domains), which works well, apart from when installing WP-Super-Cache.

    The two issues I hit were:

    1. My wp-config.php file actually just imports the site-specific config file like so:
    <?php include $_SERVER['DOCUMENT_ROOT'] . '../wp-config.php' ?>

    So when this is added as part of the install:
    define('WP_CACHE', true); //Added by WP-Cache Manager
    It simply doesn't work. (It shows that at the top of the page!)

    You might consider that is just due to my strange setup, however, the second is more of an issue:

    2. I get this error (folder structure disguised, but hopefully makes sense):
    [Thu Jul 29 23:37:31 2010] [error] [client 127.0.0.1] PHP Warning: include() [function.include]: Failed opening '/Absolute/Path/To/Site//wp-content/Absolute/Path/To/Site/wp-content/plugins/wp-super-cache/wp-cache-base.php' for inclusion (include_path='.:') in /Absolute/Path/To/Site/wp-content/plugins/wp-super-cache/wp-cache.php on line 53

    That's the first use of WPCACHEHOME

    If I add this line to my wp-config.php file it works fine:
    define( 'WPCACHEHOME', WP_CONTENT_DIR . '/plugins/wp-super-cache/' );

    So I think it must be due to the simlink to the wordpress folder?

  2. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    It probably is due to your unusual setup. You'll probably just have to define WPCACHEHOME in each site.

  3. alastc
    Member
    Posted 3 years ago #

    Fair enough, but would it be possible to make the addition to the wp-config file more robust?

    E.g. check that the file contains one of the standard settings before adding something to it.

  4. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    It's not an easy thing to do unfortunately. If you have separate wp-config files for each site how is the plugin supposed to know where each one is? I'm slow to add code that won't be used by the vast majority of users when that code could screw things up for everyone else (and it has happened, one small little bugfix and it blows up in my face when it goes live).

    If you can send me a patch that does what you want then I'll certainly look at it, but I don't have any site set up like yours (I do have multiple sites using one WP, but they all have one wp-config.php, with a switch statement for db configuration).

  5. alastc
    Member
    Posted 3 years ago #

    I'm not really a programmer (front-end guy), but I was just thinking of logic like:
    If the file has a statement about WP database setting, add this line, else skip.

    However, your approach with the single wp-config file with switch statements might be a more robust approach all-round, so I'll explore that instead :)

    Thanks for the suggestion!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic