chmod failed:operation not permited

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
Fábio Selinger
Forum Newbie
Posts: 7
Joined: Wed Jul 17, 2002 3:21 am
Location: Porto Alegre/RS

chmod failed:operation not permited

Post by Fábio Selinger »

im brazilian and my english is poor...

when i try to change the permissions of the any file, the browser show me its:

warning:chmod failed:operation not permited.

what the problem :?: :?: :?:
will
Forum Contributor
Posts: 120
Joined: Fri Jun 21, 2002 9:38 am
Location: Memphis, TN

Post by will »

someone correct me if i get off a little bit here....

(assuming you're using apache)...

in the apache config file, you specify a user for apache to run as... often something like 'apache' or 'nobody'. this is the "user" that is attempting to chmod your files via the PHP function. say for example you have a file with the following permissions.

Code: Select all

-rwxr-xr-x    1 will    users    5288 Jun 19 14:23 index.php
if apache is running as user 'nobody' in group 'nogroup' (the default i believe), you would be unable to chmod this file since 'nobody' doesn't have permission to do anything. there is a configuration option to allow you to chmod things as root (--suexec i think), but it can cause quite a security risk.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You don't say which operating system you're running but if it's Windows you should note this about chmod():
php manual wrote:Note: This function is not implemented on Windows platforms.
Mac
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

on windows (at least w2k) unknown chmod-values simply have no effects. No error, no warning so far
User avatar
kenny
Forum Newbie
Posts: 12
Joined: Mon Jul 01, 2002 10:12 pm
Location: Florida

Post by kenny »

yes, what volka and twigletmac said. I used to have the same problem, because I recently found out that my host uses windows, and you do not have to set permission.s :D
Fábio Selinger
Forum Newbie
Posts: 7
Joined: Wed Jul 17, 2002 3:21 am
Location: Porto Alegre/RS

???

Post by Fábio Selinger »

My host uses linux/apache
and i not found the solutions...
Post Reply