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);" .
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!