Re: Warning: chmod(): Operation not permitted ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 17, 2006 6:01 pm, tedd wrote:
> chmod($url, 0755);  //where $url is the file I want to change.

If $url is an actual URL to the file, with http:// in the front, you
almost for sure cannot chmod that...

You have to chmod it as a FILE in the file-system.

> That confuses me, because who's the user here? Is it just the system
> administrator or the application?

In Apache with PHP as a Module, it's the User directive in httpd.conf

With CGI, it's that same user, unless it's with suExec, then it could
be anybody, unless...

In IIS, it's probably E_MACHINE_USERNAME user -- but you're on your
own for that one.

The EASIEST way to find out, however, is <?php phpinfo();?> which will
TELL you which user it is.

> And if it is just the system administrator, then can't the system
> admin change anything he/she wants anyway? What's the point of having
> uid and gid's if a program can't change the permissions of a sibling
> file?

You do *NOT* want your webserver running as sysadmin!!!

THAT WOULD BE REALLY BAD!!!

And as to what's the point of uid and gid and who can change what,
it's so far off-topic here, in general, that I'll just ignore it,
except to say that PHP runs as a specific user, and that user can ONLY
change the files it is allowed to change, and that is a GOOD THING.

> I have tons of references as to what php filesystem functions are
> available, but I need a good reference as to what permissions are and
> how they actually can be changed in php -- does anyone have one a
> good reference OR care to explain?

You should be able to Google for a "Linux filesystem permissions
how-to" and get what you want here.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux