PHP ftp_site() 함수
예시
FTP SITE 명령 보내기:
<?php
// connect and login to FTP server
$ftp_server = "ftp.example.com";
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
// try to send SITE command
if (ftp_site($ftp_conn, "chmod 777 serverfile.txt"))
{
echo "Command executed successfully";
}
else
{
echo "Command failed";
}
// close connection
ftp_close($ftp_conn);
?>
정의 및 사용
ftp_site() 함수는 FTP 서버에 SITE 명령을 보냅니다.
참고: SITE 명령은 서버마다 다릅니다. 파일 권한 및 그룹 구성원과 같은 OS 특정 기능을 처리하는 데 유용합니다.
팁: 사용 가능한 SITE 명령을 보려면 ftp_raw() 함수 를 사용하여 REMOTEHELP 명령을 보내십시오 .
통사론
ftp_site(ftp_conn, command);
매개변수 값
Parameter | Description |
---|---|
ftp_conn | Required. Specifies the FTP connection to use |
command | Required. Specifies the SITE command (this parameter is not escaped) |
기술적 세부 사항
반환 값: | 성공하면 TRUE, 실패하면 FALSE |
---|---|
PHP 버전: | 4+ |
❮ PHP FTP 참조