Home>Article>Backend Development> How to set php folder permissions

How to set php folder permissions

藏色散人
藏色散人 Original
2020-07-25 09:56:44 3596browse

You can use the chmod function to set folder permissions in php. The syntax of this function is "chmod(file,mode)", where the parameter "file" represents the file to be checked, and the parameter "mode" specifies New permissions, and the mode parameter consists of 4 numbers.

How to set php folder permissions

Recommended: "PHP Tutorial"

php folder permission settings:

chmod() function changes the file mode. chmod — Changes file mode Returns TRUE if successful, FALSE otherwise.

Syntax

chmod(file,mode)

Parameters, description

file (required): Specifies the file to be checked.

mode (optional):

Specifies new permissions.

The mode parameter consists of 4 numbers:

The first number is always 0

The second number specifies the owner's permissions

The second The first number specifies the permissions of the user group to which the owner belongs

The fourth number specifies the permissions of everyone else

Possible values (if you need to set multiple permissions, please adjust the numbers below Total):

1 - Execute permission

2 - Write permission

4 - Read permission

How to set php folder permissions

The above is the detailed content of How to set php folder permissions. 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