[PHP] 디렉토리가 존재하는지, 쓰기권한이 있는지 미리 검사

1. 디렉토리가 있는지 검사한다.

2. 디렉토리에 쓰기권한이 있는지 검사한다.

$dir = "/home/www/dir/upload";
if(is_dir($dir)==false) {
    echo "디렉토리가 존재하지 않습니다."; exit;
}
if(is_writable($dir)==false) {
    echo "디렉토리에 쓰기권한이 없습니다."; exit
}

댓글 없음:

댓글 쓰기

[SSL] [letsencrypt] [certbot] 와일드카드 인증서 발급하기

1. 환경   ubuntu 20.x  nginx 2. 설치   apt-get install letsencrypt -y  3. 인증서 발급   ; example.com 도메인에 대해 와일드카드 인증서를 발급받는다. certbot certonly --ma...