When we manipulate the file, we often durable the chmod function to change the operation permissions of the specified directory.
When we manipulate the file, we often durable the chmod function to change the operation permissions of the specified directory.
Property
(PHP 4, PHP 5)
Match chmod-Change file mode
Describe
Boolean attribute (string $ file name, International $ mode)
Attempts to change the mode specified by the file to the provided mode.
Parameters
Filename
The file path.
Mode
Note that the pattern is not automatically assumed to be an octal value, so strings (such as "G + W") will not work correctly. In order to ensure the expected operation, you need the prefix mode 0 (0):
chmod ("/somedir/somefile", 755); Decimal Probably incorrect
chmod ("/somedir/somefile", "U+rwx,go+rx"); String Incorrect
chmod ("/somedir/somefile", 0755); octal; Correct value of mode
?>
The mode parameter contains three octal components that specify the owner of the access limit, and the owner of the user group is in the same order as the other person. A component can be computed, adding the necessary permissions to this target user group. Number 1 means you grant execution, number 2nd means your file is written, and number 4th means your file is readable. These numbers have been purchased to specify the rights required. You can also read more about patterns with UNIX systems ' man 1 properties ' and ' People 2 attributes.
Read and write for owner, nothing for everybody else
chmod ("/somedir/somefile", 0600);
Read and write for owner, read for everybody else
chmod ("/somedir/somefile", 0644);
Everything for owner, read and execute for others
chmod ("/somedir/somefile", 0755);
Everything for owner, read and execute for owner ' s group
chmod ("/somedir/somefile", 0750);
?>
Edit the recommended function:
04-25php dir Function Example Tutorial
04-25php chroot-Change root function
04-25php chdir changing directory functions Tutorial
http://www.bkjia.com/PHPjc/445486.html www.bkjia.com true http://www.bkjia.com/PHPjc/445486.html techarticle when we manipulate the file, we often durable the chmod function to change the operation permission of the specified directory Oh, when we manipulate the file, we often durable the chmod function to change the operation permissions of the specified directory Oh, ...