We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21893
    • 113 Posts
    Hi,
    I moved an installation from my testing server to a new server of my client.
    The required folder and file permission where different on the new server (im do not know much about this stuff).
    First I had to set perssion up to 777, (which couldn't be right) for confic and sitecache files, but i still couldn't use the filemanager.

    however - finally I found a solution in www - special problem regarding the hoster - where they told me to change the user-right.
    I used a tool from the provider to change from w..... user to "php-user"

    Now so far i do not have any more problems, but there is still an error-warning if i used the filemanager in Backend - beside that, its working.
    Warning: scandir(/www/htdocs/xxx/logs): failed to open dir: Permission denied in /www/htdocs/w0108a44/manager/actions/files.dynamic.php on line 481
    
    Warning: scandir(): (errno 13): Permission denied in /www/htdocs/xxx/manager/actions/files.dynamic.php on line 481
    
    Warning: Invalid argument supplied for foreach() in /www/htdocs/xxx/manager/actions/files.dynamic.php on line 482


    What can I do - or - what is the reason for this error. And is it important?

    Thanks
    Nudibranch
      Smile, it confuses people!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      There are two ways to handle PHP scripts. One is to use an Apache module, and the script is run through Apache using the Apache user. This means that the files and folders you install are owned by you, so you have to set the permissions to 777 for folders and 666 for files (the third number is for what "everybody" or "world" can do) (like cache, images, etc) where MODx will need to write to these folders.

      The other way is to use some form of "suexec" (Switch User EXEcute), so that when Apache wants to execute a .php script (like index.php) it automatically switches the user to the .php file's owner (you). This way, the usual requirements are 755 for folders and 644 for files. Some servers will actually quit with 500 server errors if the permissions are not set this way.
        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
        • 21893
        • 113 Posts
        Hi Susan,

        on the old server they used "suexec" (even if i dont understand that in detail")

        On the new on, i made a test-installation (new one) and everthing was working fine without changing any rights. (And the filepermissions have been 755 and 644) However when i moved my clients site i got the described problems.

        Since Im in a hurry, because the clients site should be online on this friday, i will care about semi-important problems after that. But I want to prevent from a "desaster" on friday so i want to be sure its not a mandatory problem.

        If I understand you right, it was the right way to change the php-user, but i do have to change some folder permission to 777 and filepermission to 666?
        So the error described above is a result of wrong permission?

        Thanks

          Smile, it confuses people!
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Different hosting companies work differently. I can't really say. I would recommend talking to your hosting company's tech support.
            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