We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53492
    • 1 Posts
    I have had this issue on a number of occasions and haven't found any posts that solve the issue so I decided help the community by sharing my resolution.

    The Issue:
    You go to MODx Manager -> Files and then try to create a directory or upload a file or image. The error will read something like "The web-server does not have necessary permissions".

    Possible Solutions:

    Here is a list of things to check. I wanted to be comprehensive as most of this information is scattered across many different posts.

    File Permissions - The first things to check are always related to file and directory permissions
    MODx suggests Directories to have 755 and Files 644.

    Some people will suggest to set it to 777 and this may work but it is a severe security breach of your site. This allows everybody full access to that directory. You don't want that. This is how sites get dirty pictures where they used to have nice stock images because somebody uploaded a new image with the same name.

    Paths - If you have a fresh install this is almost always correct but if you moved the site you will need to make sure that the configurations files have the correct paths:

    config.core.php in the root directory of your installation
    /core/config/config.core.php 
    /connectors/config.core.php
    /manager/config.core.php


    The base directories and other directory paths must be correct. Also and IMPORTANT to note is that some paths are aliases to another location. You need to use the real path to the location.

    Example:
    
    /home/bitnami/httdocs is really an alias for /opt/bitnami/apache2/htdocs
    
    In linux if you use ls -fal you may see a listing like this:
    lrwxrwxrwx 1 bitnami bitnami   27 Oct 28  2016 htdocs -> /opt/bitnami/apache2/htdocs


    Webserver Owner and Group - This is the one that eluded me for a while. It's rare but on occasion and especially when moving a site you might get the directory owner and group settings wrong. They may be one thing on one server but different on another.

    One common way to find out the owner and group is to issue the following command:
    ps aux | grep apache


    Then the group
    groups [USERNAME]


    Now you can test a single directory and if that solves your issue do it for all directories.

    For Example if you find that the user and group are www-user then issue this command:

    sudo chmod -R www-user:www-user *


    Make sure you are in the directory all files and directories will then be changed. Also take note of what it was before so you can return to what it was if it doesn't work.

    .htaccess - Sometimes the HTACCESS file can cause issues. If you rename it to htaccess.txt then test you will find out pretty quickly if this was the issue.

    These are the common issues I have faced especially when I move a site I hope it helps others to solve there issues.

    - Glen
    [ed. note: barnent1 last edited this post 9 years, 4 months ago.]