We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3315
    • 7 Posts
    I was running a multi-domain Revolution 2.0.8-pl advanced and upgraded to Revolution 2.1.1-pl advanced on a LAMP system and after the upgrade I could no longer get snippets to run from outside of the installation directory are there any changes to the way snippets load in 2.1.1-pl? After downgrading back to 2.0.8-pl with a backup I regained the ability to execute snippets from an outside account. One note...after the upgrade I was able to load the context along with documents just not snippets. Thank you for your help. (php ver. 5.3.5, mysql 5.0.91)
    • Quote from: bigbt at Jun 03, 2011, 05:09 PM

      I was running a multi-domain Revolution 2.0.8-pl advanced and upgraded to Revolution 2.1.1-pl advanced on a LAMP system and after the upgrade I could no longer get snippets to run from outside of the installation directory are there any changes to the way snippets load in 2.1.1-pl? After downgrading back to 2.0.8-pl with a backup I regained the ability to execute snippets from an outside account. One note...after the upgrade I was able to load the context along with documents just not snippets. Thank you for your help. (php ver. 5.3.5, mysql 5.0.91)
      Sorry, but I don’t understand what "get snippets to run from outside the installation directory" means. Code examples might be useful.
        • 3315
        • 7 Posts
        Thank you for your help hopefully I can better clarify the problem. I have a server running cpanel with multiple accounts all pointing to one account with the revolution installation via the index.php file. In order for this to work I just had to set apache/server group rules in order for one account to access another accounts files. I attempted to updated to 2.1.0 and 2.1.1, but after the upgrade I could no longer run snippets from outside the main domain. This does work with any revolution version 2.0.8 and below.

        Lets say I have 2 accounts/domains and one is www.myfirstdomain.com and the second is www.myseconddomain.com. The www.myfirstdomain.com has the revolution installation and www.myseconddomain.com has the index.php file that references the first domain’s revolution installation.

        If I run [[Wayfinder? &startId=`0`]] from www.myfirstdomain.com I can see the wayfinder output, but if I try to run [[Wayfinder? &startId=`0`]] from www.myseconddomain.com I get a blank output on any snippet call. The second domain will pull static text from the document/resource, but can’t display snippets.
        • Can you be more specific? As I said, any code you have used to "reference" the other domain, etc. Is myseconddomain.com a Context?
            • 3315
            • 7 Posts
            myseconddomain.com does have it’s own context, but to make sure I wasn’t having any strange issues I decided to start fresh with a completely new install using a different domain / cpanel account.

            after setting up the new domain / account on cpanel everything works great on the installed domain using the default web context. I then setup the myseconddomain.com reference by creating a new account in cpanel and then copied over the config.core.php and the index.php files from the myfirstdomain.com installation.

            edited config.core.php file has to point to correct dir
            define('MODX_CORE_PATH', '/home/myfirstdomain/public_html/core/');
            define('MODX_CONFIG_KEY', 'config');


            There is nothing changed in my index.php file, because I used the default web context if I was going to use a different context I would just change
            $modx->initialize('myseconddomain');


            From here I had to change some base_dir rules and group file access rules to allow files access outside of their root account. Once this is done the myseconddomain.com can view the default web context, but it can’t run any snippets from myseconddomain.com. One thing I did notice is that if I run the web context from myfirstdomain.com and allow it to be cached then myseconddomain.com can also view that cached pull from the snippet, so pulling all static material seems to be fine just can’t get snippets to run.

            Again these settings work on rev 2.0.8 and below....Thank you for help
            • Each Context has it’s own cache. I guess I do not know what the actual problem is with your additional domains. I have Contexts setup in a variety of ways here for testing and I cannot reproduce the behavior of a Snippet not "loading" in any of these additional Contexts.
                • 3315
                • 7 Posts
                Ignore my comments about the context cache working it really has no relevance. I was just trying to state that I know my permissions are correct, because I can load run php files from that account without a problem. The issue is that any snippet that is loaded from an account outside of the installed account doesn’t execute the snippet "php script".

                Today I did get a chance to try a multi-domain setup on a windows 2008 server running plesk and it did allow me execute snippets from an outside account, so I believe it maybe a permissions setting in linux/cPanel. I am lost as to why rev2.0.8 and below works, but I will continue to look.
                  • 3315
                  • 7 Posts
                  --problem solved--

                  I have been able to resolve this issue by playing around with different php handlers (suPHP and fastcgi) and linux file permissions (755 and 775) on the modx cache folders. Just make sure that you have group access setup on the cache files and that each user account has group access to each other. Lastly I played around with suPHP and fastcgi it seems as though fastcgi will be a better setup for multi-account access, but I’m still going through and pros and cons of various handlers.