Forum Replies Created

Viewing 1 replies (of 1 total)
  • If you have already tried changing ownership and permissions on your wp-content directory, checked and re-checked that the user WordPress/PHP is running under matches the owner of the wp-content directory, then it is possible SELinux could be the cause of permissions still being denied.

    As a quick test (this will disable SELinux enforcement):
    # setenforce 0

    Then try whatever is throwing the “Could not create directory” error in WordPress, and see if it is resolved.

    Remember to re-enable afterward:
    # setenforce 1

    If that fixes the issue, try this as a permanent solution, substituting the path to your wp-content folder as necessary – note that the absolute path is necessary in the first command:

    # semanage fcontext -a -t httpd_sys_rw_content_t '/usr/share/nginx/html/wp-content(/.*)?'
    # restorecon -Rv /usr/share/nginx/html/wp-content

    I’ve seen other posts elsewhere which mention changing the context type to “httpd_sys_content_t” when having SELinux/PHP/mkdir permissions issues, but I found that to not be enough. The “httpd_sys_rw_content_t” type was the ticket.

Viewing 1 replies (of 1 total)