More about file/directory permissions
| From: | Jacob Kruger | Date: | Fri, 30 Aug 2013 22:01:30 +0000 |
| Subject: | More about file/directory permissions | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-31162@lists.php.net to get a copy of this message | ||
With regards to that CMS system of mine, I am, if necessary, creating the output/upload
directories/folders when they need to be made use of using the following function call in PHP code:
mkdir("./sites/" . $sRelPath, 0776);
mkdir("./sites/" . $sRelPath . "/images", 0776);
I can then do something like copy an uploaded image file to that directory using copy().
However, thereafter, I can't access them via other sort of interface channels, and, if I ask
fileZilla to, for example, tell me permissions on the site's sort of virtual root
directory/folder inside the /sites folder/directory, it tells me: 754
Which doesn't make sense, unless some or other automated process on the server is resetting
permissions after I created the item during/at run-time?
The primary issue there is that of the three numbers - owner-group-public - while 5 = read/execute,
it doesn't include write - which means can then not generate content/output in those folders,
and, like said, don't seem to generally be able to browse there either using FTP clients,
although read is turned on - 4 = read, 1 = execute, and 2 = write/change - so, 7 = all rights, 5 =
read/execute, but not change/write.
Thoughts/suggestions?
And, at moment, while trying to figure out what's causing this issue, I am using a sort of
utility bit of PHP script to clean up file structure by running a sort of manually defined set of
chown() and chmod() functions to firstly take complete control of the then rendered files and
directories - just in case, before setting their permissions to 777 - all rights to all, and to then
unlink() and rmdir() either/or, but, after setting permissions like that, I can then browse the file
structure using ftp client - either command line, or fileZilla, but, before resetting permissions,
it seems to not want to cooperate?
Know this isn't 100% relevant to php-windows, but, part of irritation/issue with this is since
develop on windows7, where this isn't an issue, it's a bit irritating that code/execution
works quite happily on my development machine, but, won't then cooperate when published to
server, etc.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'