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

How to solve the problem of php mkdir failure

藏色散人
Release: 2023-03-05 11:20:01
Original
3867 people have browsed it

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);
Copy after login

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!

Related labels:
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template