We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46577
    • 54 Posts
    This seems so crazyily basic I hesitate to post...

    New install of Revo 2.5.0 on Virtualbox Ubuntu server 14.04 with LAMP. Install went fine, couple of gotchas with ownership/access permissions, no big deal...

    Created a template and a couple of pages (static resources), all good, no problem at all.

    Ok now for some snippets. Uh oh, complete blankness where the output should appear. Doink.

    Let's try some sample code from http://bobsguides.com/modx-snippets.html, just in case I'm just a bit rusty:

    $output = "<p>This is the first line of my snippet.</p>";
    $output .= "<p>This is the second line of my snippet.</p>";
    $output .= "<p>This is the third line of my snippet.</p>";
    return $output;


    I called my snippet 'test', then called it from a new test page like this:

    <p>from <a href="http://bobsguides.com/modx-snippets.html">Bob's Guides</a></p>
    <p>[[!test]]</p>


    But when I view my test page in a browser, the snippet is completely missing. Viewing the page source there are the <p></p> tags but nothing inside.

    Tried the same test on a live website hosted online, everything works as expected.

    In the error log I see
    (ERROR @ /var/www/html/core/model/modx/modcachemanager.class.php : 515) Error caching script elements/modsnippet/4

    Tried calling the snippet cached and uncached, same error. Doesn't mean a lot to me, and not much of any relevance thrown up by a google search.

    So I am tempted to conclude that there is some kind of problem with my server or modx setup, but what could it be?

    This question has been answered by grogorio. See the first response.

      • 37523
      • 141 Posts
      Just a thought based on a gut feeling. Are the permissions set correctly for the caching directory on the server? On mine they are 755.
        Glyn Szasz
        Sydney, Australia

        Happy to help (when can) and happy to learn

        If you are a Sydney based MODX developer would love to hear from you. Please contact me.
      • discuss.answer
        • 46577
        • 54 Posts
        Thanks for your input Glyn. Permissions are 755. I tried setting 777 just for the hell of it, no difference.

        I think as long as the core directory exists and is writeable (as prompted during setup), this will be the case. You can even delete the contents of the cache directory, and modx will recreate them with the correct permissions.

        However your suggestion prompted me to check ownership, and I figured it out... ownership of the cache directory needs to be www-data, so problem solved.

        I'm not sure how the owner came to be wrong to start with (maybe the way I created the core directory during setup - not sure), or why it wasn't flagged as a problem, or why I've never encountered this before (maybe a specific case for installation on Virtualbox???). [ed. note: grogorio last edited this post 7 years, 9 months ago.]
          • 37523
          • 141 Posts
          glad to read. Permissions and ownership is a murky area if you are not on top of it.
            Glyn Szasz
            Sydney, Australia

            Happy to help (when can) and happy to learn

            If you are a Sydney based MODX developer would love to hear from you. Please contact me.