How to set permissions for php directory permissions

藏色散人
Release: 2023-03-07 20:16:02
Original
2339 people have browsed it

How to set permissions for php directory permissions: First create a PHP sample file; then set the owner to be readable and writable through the "chmod("test.txt",0600); method, but others will not have any permissions That’s it.

How to set permissions for php directory permissions

The operating environment of this tutorial: Windows 7 system, PHP version 5.6. This method is suitable for all brands of computers.

Recommended: "PHP Video Tutorial"

php method of setting directory permissions

There is a php function: chomd() ;

chmod() function changes the file mode.

chmod(file,mode) Parameter Description

file Required. Specifies the documents to be checked.

mode Optional. Specify 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

Copy after login

The directory is the same, change the file name into directory path

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

Related labels:
php
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!