The uploaded file could not be moved to wp-content/uploads/2023/01.

아파치와 php를 재설치하고 워드프레스를 재 실행했다. 워드프레스에서 이미지 파일을 업로드하려는데 제목과 같은 에러 메세지가 생성되었다. wp-content/uploads 디렉토리의 모드를 766으로 변경하라고 한다.

# chmod -R 766 uploads/

하지만 이번의 경우는 아파치 설정파일에서 실행 사용자와 그룹명을 워드프레스 디렉터리 사용자.그룹과 일치 시켜주어야 했다.

vi httpd.conf

#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User worduser
Group wordgrp
# ls -al
합계 32
drwxr-xr-x.  7 worduser wordgrp 4096  1월  4 13:17 .
drwxr-xr-x.  5 worduser wordgrp 4096  1월  2 12:05 ..
-rw-r--r--.  1 worduser wordgrp   28 11월 21 14:12 index.php
drwxr-xr-x.  4 worduser wordgrp 4096 12월 26 13:54 languages
drwxr-xr-x. 13 worduser wordgrp 4096 12월 26 13:53 plugins
drwxr-xr-x. 11 worduser wordgrp 4096 11월 21 14:20 themes
drwxr-xr-x.  2 worduser wordgrp 4096 12월 26 13:54 upgrade
drwxr-xr-x. 12 worduser wordgrp 4096  1월  4 09:09 uploads