We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31902
    • 342 Posts
    For whatever reason, no matter what MODx Revolution site I'm working on, I stumble on some problem in the system that has no obvious cause. After spending too much time troubleshooting, I'll hop onto the server control panel (DirectAdmin) and find, through the file manager, that some directory (more often than not, it's a cache directory) has permissions or ownerships changed. Directories that I know I've made writable (777) are magically no longer that way. Worse, I find that some directories have changed ownership from the account name to apache.

    Whereas my first thought is to blame something about my server configuration (I admint I'm not much of a server expert), I keep wondering if there is something about MODx Revolution I should be looking at first.

    So, is there anything about MODx Revolution that can do this kind of thing? Thank you in advance.

    Problem happens on various MODx installs, from 2.1.3 to 2.2.6.
    PHP Version 5.3.22
      • 3749
      • 24,544 Posts
      I was surprised to find chmod commands in the MODX core. PhpThumb, for example, has one that's hard-coded to 644, and smarty writes cache files using smarty->_file_perms as the value (not sure where that comes from), so maybe MODX is the culprit.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 31902
        • 342 Posts
        Quote from: BobRay at Mar 12, 2013, 08:27 PM
        I was surprised to find chmod commands in the MODX core. PhpThumb, for example, has one that's hard-coded to 644, and smarty writes cache files using smarty->_file_perms as the value (not sure where that comes from), so maybe MODX is the culprit.

        If that's the case, you would think that everyone is having the same issues as I am?

        BTW: has anyone used phpSuExec on their server(s)? Would that help with intermittent permission/ownership problems?
          • 3749
          • 24,544 Posts
          phpSuExec generally likes 755/644 permissions and I think it can help with ownership problems as well, so it might be a solution. Susan Ottwell could give you a more informed answer.

          I've never encountered your problem and it may be because all the servers I use are running SuExec or SuPhP.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 31902
            • 342 Posts
            Thank you, Bob. I'll look into it further.
            • I am aware that MODx does some file permissions settings, particularly since you can set the permissions for new files during installation, but I've not yet been able to track down exactly where this gets done.

              Even on Cloud servers, I get the occasional cache error, as well as when installing or removing packages, as if the files and/or directories had the wrong permissions. Even on a very stable OSX/MAMP setup I'm getting these:
              [2013-03-06 19:02:11] (ERROR @ /revo226/index.php) Error caching lexicon topic lexicon/en/wayfinder/properties
              [2013-03-06 19:02:11] (ERROR @ /revo226/index.php) Could not cache resource 5

              So something is "off" somewhere, but I have no idea what it could be.

                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 31902
                • 342 Posts
                Thanks for responding, Susan. The hunt goes on, I guess.

                I assume this does not qualify as a bug, right? We've had our server folks make sure the servers are configured right, at least as per the requirements on this page:

                http://rtfm.modx.com/display/revolution20/Server+Requirements

                The only thing I can think of as a solution at this point is the SuExec or SuPhP route. I know our servers don't have them installed at the moment.