I have a Linux server with appache as the web server. In my PHP script I am making directories with 0777
mode. the code is pretty simple as follows:
mkdir($path,0777)
when I run this script and go to my server file manager, the folder is there but the permission assigned to that folder is 0755. I can't figure out why this is happening!! when the folder is created the user column has apache in it but the permission is 0755.
[ErrorException] mkdir(): Permission denied. That means you do not have write permission on your project folder. Create a new folder, say 'myproject and run sudo chmod 777 myproject . Then move to 'myproject' folder and create project.
The mkdir command creates one or more directory elements. (Operating system directory creation commands create view-private directories, not elements.) Unless you specify the –nco (no checkout) option, the new directory is checked out automatically.
Methods: file_exists(): It is an inbuilt function that is used to check whether a file or directory exists or not. is_dir(): It is also used to check whether a file or directory exists or not. mkdir() : This function creates a directory.
You can try:
chmod ( string $filename , int $mode )
See if that can fix the permissions issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With