chmod warning issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rskumar20
Forum Newbie
Posts: 3
Joined: Fri Oct 06, 2006 5:01 am

chmod warning issue

Post 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
User avatar
Vikas Jayna
Forum Newbie
Posts: 3
Joined: Tue Apr 11, 2006 1:17 am

Post 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.
Post Reply