10 articles about phpumask () functions are recommended.

Source: Internet
Author: User
When using mkdir to create a folder, we found that this function has two parameters. The second parameter is to specify permissions for the newly created folder. However, if mkdir (& amp; #39; file address & amp; #39;, 0777); is used directly, the permission for the new folder is not 777, generally, the value is 022. When mkdir sets a permission for a folder, it matches the umask (default permission attribute) value of the currently logged-on operating system user. the obtained value is the final permission value. What is umask? When we use mkdir to create a folder, we find that this function has two parameters. The second parameter is to specify permissions for the newly created folder. However, if mkdir ('file address', 0777) is used directly, the permission of the new folder is not 777, which is generally. Because when mkdir sets a permission for a folder, it matches the umask (default permission attribute) value of the user Currently logged on to the operating system. the obtained value is the final permission value. What is umask? What is the default permission for creating a file? How can I change the default permission? When we log on to the system and create a file, there is always a default permission. how does this permission come from? This is what umask does. Umask sets the default permission for the user to create files, which is the opposite of chmod. umask sets the permission "complement", while chmod sets the file permission code. Generally, you can set it in/etc/profile, $ HOME/. bash_profile, or $ HOME/. profile.

1. PHP mkdir () has no write permission. Solution

Introduction: However, MySQL has 700 permissions on the newly created Database Directory and 660 permissions on the data table file, which makes us confused. Does MySQL depend on the value set by the system? Reference

9. PHP mkdir () has no write permission. Solution _ php instance

Introduction: This article describes how to solve the problem of PHP mkdir () having no write permission. it explains umask in detail and how to solve the problem of mkdir () having no write permission, for more information, see

10. use the mkdir () function of php to create a secure folder. permission setting method _ php instance

Introduction: This article mainly introduces the php mkdir () function to create secure permission settings for folders. in this case, the system umask affects the specified permission parameters of mkdir, which is smaller than expected, this problem does not occur when using the chmod function. For more information, see

[Related Q & A recommendations ]:

Centos-how to modify apache umask?

Apache-linux (ubuntu) php development, how to set htdocs/wwwroot (Directory and its subdirectories/Files) permissions

Why can't I run files on a disk after I mount a disk with umask = dmask = fmask = 000 in linux?

Can the nginx-Web file system umask be customized?

In linux, how does one view the usage of shell built-in commands?

The above is a detailed article about the php umask () function. For more information, see other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.