Home>Article>Backend Development> How to set file permissions in php

How to set file permissions in php

WJ
WJ Original
2020-06-01 13:20:01 3103browse

How to set file permissions in php

The way to set file permissions in php is:

Use the chmod function
The mode parameter contains three octal numbers, which are specified in order. The owner, the owner's group, and access restrictions for everyone. Each part can be calculated by adding the required permissions. The number 1 makes the file executable, the number 2 makes the file writable, and the number 4 makes the file readable. Add these numbers to specify the required permissions.

Related references:php中文网

The above is the detailed content of How to set file permissions in php. For more information, please follow other related articles on the PHP Chinese website!

php
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn