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’m running revolution advanced 2.0.2 on a LAMP setup and I haven’t been able to get the runSnippet function to work outside of the account that revolution is installed on. I originally thought that maybe it was a php or apache security issue, so I tweaked my suexec and basedir settings to make sure that I have the ability to use files across accounts, but still no success. I can use other functions such as getChunk just not runSnippet. I went into the modx.class.php and the xpdo.class.php files and everything looks clean up to:

    $output = $snippet->process($params);

    runSnippet output is always blank when I run from an outside account, but works fine if I run the function from the modx installed account. Oh and I did check the $snippet variable and it seems to be good just the process call does something bad.

    Thanks in advance for anyone’s help on this

    Below is the php file i’m using on the outside account to access revolution core

    require_once '/pathto/mysite/config.core.php';  
    require_once MODX_CORE_PATH.'config/'.MODX_CONFIG_KEY.'.inc.php';  
    require_once MODX_CORE_PATH.'model/modx/modx.class.php';  
    $modx = new modX();  
    $modx->initialize('web');
    
    echo $modx->runSnippet(testSnippet);
    echo $modx->getChunk(testChunk);




    ------10/10/10 update to post------

    Thought I should post a follow up after realizing what my issue was just in case anyone else out there is having the same problem. Basically it was a permission issue that was resolved by removing restrictions to the base directory and also making sure that both cpanel accounts have group access to the revolution installation account. When I first posted this request I only had basedir restrictions removed, which was allowing me to do everything except for execute snippets from an account outside of the revolution installed account.

    For those asking why would I want to do this the main motivation was to be able to have multiple cpanel accounts access one revolution installation. By not using add-on domains under one account I can now easily apply a separate IP/SSL to any domain. Keep in mind to do something like this you will need shell / higher access than a shared hosting account would allow.