Home  >  Article  >  Backend Development  >  How to solve the problem of php mkdir failure

How to solve the problem of php mkdir failure

藏色散人
藏色散人Original
2020-08-28 10:08:273744browse

Solution to the failure of php mkdir: First find the "/etc/bashrc" configuration file; then modify the permissions through "mkdir('test', 0777);chmod('test', 0777);" .

How to solve the problem of php mkdir failure

Recommended: "PHP Video Tutorial"

php mkdir 777 failed

In the Linux system, there is a default permission when creating files/folders. This permission is affected by the umask setting. In the /etc/bashrc configuration file, we can find the following configuration:

This is explained here The problem is that the default umask in the Linux system is 022. After calculation with our 777 &, it becomes 755. This is the reason.

Solution:

mkdir('test', 0777);
chmod('test', 0777);

The above is the detailed content of How to solve the problem of php mkdir failure. For more information, please follow other related articles on the PHP Chinese website!

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