증상

wordpress 에서 파일을 업로드하면 아래 에러 메시지 발생

Unable to create directory wp-content/uploads/2016/02. Is its parent directory writable by the server?

 

원인

  1. 워드프레스의 컨텐츠 저장 디렉터리(wp-content/uploads)에 대해 웹 서버가 쓰기 권한이 없음
  2. wp-content 의 SELinux content 가 적절하지 않음

처리

  1. upload 폴더의 소유자 변경

    chown -R nginx:nginx wp-content/uploads/
    BASH

    아파치 웹 서버 사용시 nginx 대신 httpd 로 변경

  2. context 수정

    CentOS 7

    chcon  -R -t httpd_sys_rw_content_t wp-content
    ## 또는 selinux boolean 변경
    setsebool -P httpd_unified on
    BASH

    CentOS 6

    chcon  -R -t httpd_sys_content_t wp-content
    CODE
  3. 다시 시도하여 정상 동작하는지 확인

 

같이 보기