We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19986
    • 90 Posts
    Hi all.

    I’m in the process of migrating a modx installation to a different server and I’m having a problem which could be down to the modx cache. There were a number of references to absolute paths dotted amongst the php and database. I have updated them all but I still get a php error message related to the old path.

    open_basedir restriction in effect. File(/home/username/public_html/modx/assets/css/print.css) is not within the allowed path(s)


    After making my changes and clearing the modx cache from the manager, modx/assets/cache/siteCache.idx.php still contains references to home/username. I get the following message when I clear the cache from the manager, with Site -> Refresh site (this is a pre 0.9.5 version):

    0 documents were published.
    0 documents were unpublished.
    Cache: Found 3 files in cache directory and deleted 0 cache files.


    How does the modx cache work? Should siteCache.idx.php have been cleared of the old path if they can’t be found in any other php file nor the entire database and the cache was cleared? Shouldn’t modx have reported that 3 cache files were found and 3 were deleted?

    Note: I have cleared my browser cache and siteCache.idx.php is writable.
      • 33337
      • 3,975 Posts
      Did you update:

      Resource path: and Resource URL:

      under, Tools -> Configuration -> Interface & Features ?

      Hope this helps.

      re: 3 files, those files are necessary for MODx to work, so they will not be deleted.
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 19986
        • 90 Posts
        Thanks for your suggestion.

        I have already changed the Resource path and URL, and the file manager path. I’ve done a complete search of the database and altered two snippets that had the path hard coded. There are now no other references to the path in the database, other than in the logs. I’ve searched all php files and the only one that contains a reference to the path is modx/assets/cache/siteCache.idx.php.

        Any idea why the path could still be in siteCache.idx.php? What does this php file do?
          • 33372
          • 1,611 Posts
          You could always try overwriting your suspect cache files with the original blank ones from the installer package and see if that helps.
            "Things are not what they appear to be; nor are they otherwise." - Buddha

            "Well, gee, Buddha - that wasn't very helpful..." - ZAP

            Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
            • 19986
            • 90 Posts
            I got over my previous problem by editing siteCache.idx.php and changing any references to the old URL. Now I’ve got a different but similar problem.

            Fatal error: Cannot redeclare preparesearchcontent() (previously declared in /home/username/public_html/sitename/modx/manager/includes/document.parser.class.inc.php(705) : eval()'d code:470) in /home/username/public_html/sitename/modx/manager/includes/document.parser.class.inc.php(705) : eval()'d code on line 479


            I’ve searched the database for occurrences of the preparesearchcontent declaration and it appears only in a single snippet. Grepping the php files revealed it’s also present in modx/assets/cache/siteCache.idx.php. So, different error, same problem.

            I wish I knew whether I could delete siteCache.idx.php, because apart from anything else I’d have the pleasure of destroying it (simple things for simple minds ;-)). Since I don’t know whether I can get away with that, I’ll follow ZAP’s suggestion and try to replace it with an original from the installer package.

            Does anyone know how MODx caching works? Can any of the cache files be deleted (or blanked)?
              • 22303 MODX Staff
              • 10,725 Posts
              The easiest way to fix it is rerun the upgrade installation by putting the install files back in place... this will automatically refresh the cache files after the upgrade runs.

              You can replace those files (I believe), but your site will be broken until you go back into the manager and click refresh cache.
                • 19986
                • 90 Posts
                I did an upgrade as suggested by OpenGeek. Worked a treat. Many thanks.