regarding chown
Moderator: General Moderators
regarding chown
Dear All,
I am having problem changing owner of file . what I am doing is uploading file and after that changing its owner
by writing chown command , I am not able to change the owner at all .
can any body let me know how to do that ... by default it is giving owner as apache
I am having problem changing owner of file . what I am doing is uploading file and after that changing its owner
by writing chown command , I am not able to change the owner at all .
can any body let me know how to do that ... by default it is giving owner as apache
-
cpetercarter
- Forum Contributor
- Posts: 474
- Joined: Sat Jul 25, 2009 2:00 am
Re: regarding chown
On Unix/Linux systems, only the root user can change the owner of a file, as the php manual explains.
Re: regarding chown
cpetercarter wrote:On Unix/Linux systems, only the root user can change the owner of a file, as the php manual explains.
is there any other option to tackle this situation, I have seen ftp commands but there is no command for changing the ownership
Re: regarding chown
Work around it. Probably will end up chmod 0777-ing instead.
Why do you need to change the ownership? Are you on shared hosting? What files are you dealing with?
Why do you need to change the ownership? Are you on shared hosting? What files are you dealing with?
Re: regarding chown
There should be no reason to change the ownership, unless
a) you've got users logging into the shell that need to modify them or
b) you've got a cron job running on the server as a different user.
In both of those cases, you may put the Apache user in a group with the other users, then set the sticky group writable bit on the directory. All future created files will then be writable by group members.
a) you've got users logging into the shell that need to modify them or
b) you've got a cron job running on the server as a different user.
In both of those cases, you may put the Apache user in a group with the other users, then set the sticky group writable bit on the directory. All future created files will then be writable by group members.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: regarding chown
@tasairis
I am working on dedicated server..
@pickle &
the thing is whenever I upload any file I am getting apache as user,
and ftp user which is not able to overwrite these files when I do all change all files user as ftp user I am able to overwrite files, the ftp user has access to all folders on server...
this the problem I am facing
I am working on dedicated server..
@pickle &
the thing is whenever I upload any file I am getting apache as user,
and ftp user which is not able to overwrite these files when I do all change all files user as ftp user I am able to overwrite files, the ftp user has access to all folders on server...
this the problem I am facing
Re: regarding chown
Forget what I said about the sticky bit - apparently I was misunderstanding what it did.
You can do what ~tasairis suggestd & change the permissions on the file to world writable.
You can do what ~tasairis suggestd & change the permissions on the file to world writable.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: regarding chown
@pickle
here is the summary what I have done
1-->uploaded file
2-->changed permission as 777 with php chmod function
3--> tried to set owner with php chown function
no success on 3rd point not able to change owner , i must change the owner
here is the summary what I have done
1-->uploaded file
2-->changed permission as 777 with php chmod function
3--> tried to set owner with php chown function
no success on 3rd point not able to change owner , i must change the owner
Re: regarding chown
Well you're screwed then. Only the root user can change ownership.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: regarding chown
ohhhhhhhhh allright .... will check it out ....