How to correct the file permissions for WordPress ?

How to correct the file permissions for WordPress ?

Asked on October 24, 2018 in Wordpress.
Add Comment

  • 4 Answer(s)

    The webserver may need write access to the files.

    chown www-data:www-data -R * # Let Apache be owner
    find . -type d -exec chmod 755 {} \; # Change directory permissions rwxr-xr-x
    find . -type f -exec chmod 644 {} \; # Change file permissions rw-r--r--

        After the setup we ought to fix the entrance rights, as per Hardening WordPress all records with the exception of wp-substance ought to be writable by your client account as it were. wp-content must be writable by www-information as

    well.chown <username>:<username> -R * # Let your useraccount be owner
    chown www-data:www-data wp-content # Let apache be owner of wp-content
    Answered on October 24, 2018.
    Add Comment

    As we give the full access to every wp files to the www-data user (which are to be in the case the web server user)which could be very hard. So rather we should NOT do that:

    chown www-data:www-data -R *
    Answered on October 24, 2018.
    Add Comment

    we can set consents to:

    # Set all documents and catalogs client and gathering to wp-client
    chown wp-user:wp-client - R *
    # Set transfers organizer client and gathering to www-information
    chown www-data:www-information - R wp-content/transfers/
    # Set all catalogs consents to 755
    find . - type d - executive chmod 755 {} \;
    # Set all records authorizations to 644

    For we can have a particular client for WordPress which is not the same as the apache default client that keep access from the web to those documents possessed by that client.

    At that point it offers authorization to apache client to deal with the transfer envelope lastly set sufficiently secure record and organizer consents.

    Answered on October 24, 2018.
    Add Comment

    Right click on your WordPress folder and select Change Permissions from the menu displayed. Enter 755 in the Permission fields and click Change Permissionsto continue. Now double click your WordPress folder and find the index.php file. Right click the file and, once again, select Change Permissions.

    Answered on February 20, 2019.
    Add Comment

  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.