Did you not read ANY of the post?Takuma wrote:can't you use chmod() function?http://uk2.php.net/manual/en/function.chmod.php
Did you not read ANY of the manual?
I mean, obviously, chmod() won't work. It's been stated over and over.
Moderator: General Moderators
Did you not read ANY of the post?Takuma wrote:can't you use chmod() function?http://uk2.php.net/manual/en/function.chmod.php
Code: Select all
<?php
chmod($file,0777);
?>Code: Select all
<?php
exec("CHMOD 777 /path/to/dir");
?>And I don't think 0 comes into it...There are two arguments for chmod: the permissions and the file/directory name. The permission argument for chmod is based on numbers.
1 stands for execute.
2 stands for write.
4 stands for read.
To set more than one permission on a file/directory, you just add up the permissions. For example, 7 means read, write, and execute permissions. Chmod takes the permissions as the first argument in the order user, group, global. Thus, the command chmod 777 hello will change the permissions of the file hello to read, write and execute by user, group, and everyone else.
Note: To change the permissions of a file/directory, you must be the owner of that file/directory. However, root can change permissions on any file/directory.
Code: Select all
echo 'uid:', getenv('UID'), ' euid :', getenv ('EUID');Code: Select all
system('echo $UID');
system('echo $EUID');