如何将所有者/群组48 48更改为其他?

时间:2015-07-25 08:44:47

标签: php

我有一个上传文件的网页。上传文件时,owner/group is 48 48。我想将其更改为1036667 103667,就像其他文件一样(从filezilla上传)。所以用户无法直接查看

file(www.somewebsite.com/somefile.txt).

1 个答案:

答案 0 :(得分:0)

chmod是你的朋友。

syntax: chmod(file,mode)

mode    Required. Specifies the new permissions.

The mode parameter consists of four numbers:

The first number is always zero
The second number specifies permissions for the owner
The third number specifies permissions for the owner's user group
The fourth number specifies permissions for everybody else

Possible values (to set multiple permissions, add up the following numbers):

1 = execute permissions
2 = write permissions
4 = read permissions


eg:

<?php
// Read and write for owner, nothing for everybody else
chmod("test.txt",0600);

// Read and write for owner, read for everybody else
chmod("test.txt",0644);

// Everything for owner, read and execute for everybody else
chmod("test.txt",0755);

// Everything for owner, read for owner's group
chmod("test.txt",0740);
?>