可以使用chmod()函数来实现。
语法格式:
chmod(file,mode)
参数介绍:

具体代码:
<?php
// 所有者可读写,其他人没有任何权限
chmod("test.txt",0600);
// 所有者可读写,其他人可读
chmod("test.txt",0644);
// 所有者有所有权限,其他所有人可读和执行
chmod("test.txt",0755);
// 所有者有所有权限,所有者所在的组可读
chmod("test.txt",0740);
?>
以上就是php如何更改文件夹权限的详细内容,更多请关注天达云其它相关文章!