chmod & chown permissions

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
User avatar
daven
Forum Contributor
Posts: 332
Joined: Tue Dec 17, 2002 1:29 pm
Location: Gaithersburg, MD
Contact:

chmod & chown permissions

Post by daven »

I am attempting to use PHP's chmod() and chown() commands, but I receive the "Operation not permitted" error whenever I try to do so. The parent directory is chmod'ed rwx for all (0777).

Is there a way to get chmod to work?
easyteck
Forum Newbie
Posts: 13
Joined: Thu Jun 05, 2003 12:01 pm
Location: Ecuador
Contact:

Post by easyteck »

Well, maibe you're using php with Apache, so when script executes generally uses the user that is defined in httpd.conf file (apache)... you can change this user to try (I never did) but understand that this is a big security problem... 'cause this new apache user must have the chmod and chown permissions and anyone that uses a connection using your apache server could do the same things!!!
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

Well if the directory is 777 then any user should be able to issue the commands. Have you checked the safe_mode setting in php.ini?
Post Reply