(PHP 5, PHP 7)
ftp_chmod — 锟斤拷锟斤拷 FTP 锟斤拷锟斤拷锟斤拷锟较碉拷锟侥硷拷权锟斤拷
$ftp_stream
, int $mode
, string $filename
) : int
锟斤拷锟斤拷锟斤拷锟斤拷锟较碉拷锟侥硷拷权锟斤拷锟斤拷锟斤拷为
mode
指锟斤拷锟斤拷值锟斤拷
ftp_stream
FTP 锟斤拷锟接憋拷示锟斤拷锟斤拷
mode
要锟斤拷锟矫碉拷权锟斤拷值锟斤拷 锟剿斤拷锟斤拷 值锟斤拷
filename
远锟斤拷锟侥硷拷锟斤拷锟狡★拷
锟斤拷锟斤拷锟缴癸拷锟斤拷锟斤拷锟侥硷拷锟铰碉拷权锟睫o拷锟斤拷锟斤拷失锟杰凤拷锟斤拷 FALSE
锟斤拷
Example #1 ftp_chmod() 锟斤拷锟斤拷锟斤拷锟斤拷
<?php
$file = 'public_html/index.php';
// 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
$conn_id = ftp_connect($ftp_server);
// 使锟斤拷锟矫伙拷锟斤拷锟斤拷锟斤拷锟斤拷锟铰�
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// 锟斤拷锟斤拷锟斤拷锟斤拷 $file 锟斤拷权锟斤拷为 644
if (ftp_chmod($conn_id, 0644, $file) !== false) {
echo "$file chmoded successfully to 644\n";
} else {
echo "could not chmod $file\n";
}
// 锟截憋拷锟斤拷锟斤拷
ftp_close($conn_id);
?>