Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-10398

multiple phpbb3 on same host caching issue solution

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.0.7
    • Caching (ACM)
    • None

      It seems that phphbb3 does offer some what of a possible way of running multiple phpbb3 on the same host from the same source code by having alternate database config files, however, There is a big issue with running multiple forums because of how the caching of settings is handled.
      At the moment phpbb3 does not allow for alternate cache directory for each forum and so settings from one forum are cached and those settings are kept when shifting to another forum because the cache files do not use any sort of prefix to know from what forum they came from and just assumes that whatever is in the cache belongs to that forum.

      When checking the code its easy to spot the problem.

      The file: includes/acm/acm_file.php
      will set the cache directory based on
      dirname(_FILE_) which will result in ./cache

      I have come up with this very easy workaround.

      first create alternate cache dir's outside the document root suchs as

      /opt/phpbb3/struct/site_name/cache
      and chmod 777 on that directory.

      now in the alternate database config file (mine I have put in /etc/phpbb3/site_name.config.php)
      I added a constant called CACHE_DIR

      @define('CACHE_DIR','/opt/phpbb3/struct/site_name/cache/');

      And then I patched the acm_file.php file with

      function acm()
      {
      global $phpbb_root_path;
      if(CACHE_DIR)

      { $this->cache_dir = CACHE_DIR; }

      else

      { $this->cache_dir = $phpbb_root_path . 'cache/'; }

      }

      I think in the next release of PHPBB3 it should have the possibility to set a variable somewhere for an alternate path for directories suchs as
      /cache
      /files/
      /images/

      Of course this implies that the user has to create a directory for each site.
      OR PHPBB3 can prefix the files so that a forum would only read cache files with its own prefix.

      Is cache issue for multiple Forum something that PHPBB3 is looking into fixing in future releases?

      Does anyone have any better solution to patch this?

            Oleg Oleg [X] (Inactive)
            evilstrike55 evilstrike55
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: