Page 1 of 1

chmod warning issue

Posted: Mon Nov 13, 2006 4:24 am
by rskumar20
i'm gettin this error while using this code

chmod("vcddb/config.php", 0777);


Warning: chmod() [function.chmod]: Permission denied in c:\Inetpub\wwwroot\php\chmod.php on line 2

can anyone tell me wat to do to solve tis problem

Posted: Mon Nov 13, 2006 4:51 am
by Vikas Jayna
A user is allowed to change the permissions of a file only if he's the owner of that particular file. In this case, most probably a script containing a call to the chmod function is being executed through the browser - in such a case the user whose trying to modify the permissions is the user defined in apache's configuration (nobody or apache) which may not be the owner of the file vcddb/config.php and hence cannot modify the permissions of this file.