Page 1 of 1

Chmod: Operation not permitted

Posted: Wed Jun 24, 2009 4:34 am
by morris520
Hi I've got a problem with chmod func and couldn't get it work...

under root folder:
Ive got a.php, b.php
Im trying to use a.php to set permission mode for b.php

Code: Select all

 
<?php chmod("/b.php", 0777); ?>
 
I'm using LINX apach. and some chmod function run ok on the other file, which I used to set permission after creating an image file on the server.

So I ve got a few attempts:
1 - would it be the reason that I'm not the owner?
2 - safemode is off already, so this shouldn't be the cause.
3 - why some other functions can work? Do I miss anything?


Thanks for help folks
M

Re: Chmod: Operation not permitted

Posted: Wed Jun 24, 2009 7:57 am
by Eric!
Check to see who is the owner, is one case you're the owner, in the other with the image it is the apache process. And the chmod is coming from the apache process too...which is probably why it works on the image copy.

Re: Chmod: Operation not permitted

Posted: Wed Jun 24, 2009 9:14 am
by jaoudestudios
Also check that you need the forward slash (/) at the beginning before b.php, you might need to use full path /var/www/vhost/*DOMAIN*/....