warnockm Posted September 22, 2006 Share Posted September 22, 2006 I have a very odd problem, but i'm sure the members of phpfreaks can help. I have a linux server running PHP 5.1. I mounted a windows filesharing using cifs. The mounted directory is owned by www, my web service user. I'm using PHP to create a directory (mkdir($dir, 0777) on the share and store files in there. When i write them, i get a file permission error. When i look at the permssions, i see it is own by root, even through it was created by php (www). drwxr-xr-x 2 root root 0 Sep 22 16:11 new_dirI understand why its not writable. www can't write to this. However, the interesting thing is, when i run the script again, and it doens't have to create the directory, the files store. after the second run, the permissons change to:drwxrwxrwx 1 root root 0 Sep 22 16:26 new_dirAlso, the colors in bash change to green/white, and dircolors say its: "STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)"Why is it creating a directory owned by root. and then why do the permissions change? I'm doing nothing to change the permissions. i just check if the dir exists, create it if it doesn't, and write files to the new dir. Is it something w/ the way i mount the share?thanks! Quote Link to comment Share on other sites More sharing options...
warnockm Posted September 25, 2006 Author Share Posted September 25, 2006 no one has been replying on here. Is it me or my questions?????? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.