Page 1 of 1

user group problem on Linux + Apache

Posted: Thu Sep 24, 2009 12:12 am
by ctmaster
Hi All,
I wanna modify folders and files on the remote server(Linux + Apache) with PHP, but all of the folders and files are usually '755' purview, I can't use php to modify them.

And if I change a folder to '777', so I can modify it and create files in it, but I can't use ftp account to modify it.

The server administrator told me he doesn't like I change them to '777', I just can use the purview '755'.

So I want to know How I can solve this problem, may be I can use php to login the linux.

Thanks for all your answers.

Re: user group problem on Linux + Apache

Posted: Fri Sep 25, 2009 12:02 pm
by kaisellgren
ctmaster wrote:And if I change a folder to '777', so I can modify it and create files in it, but I can't use ftp account to modify it.
The files are 0777 and your FTP-client can't modify those files?

Re: user group problem on Linux + Apache

Posted: Sat Sep 26, 2009 9:11 pm
by ctmaster
kaisellgren wrote:
ctmaster wrote:And if I change a folder to '777', so I can modify it and create files in it, but I can't use ftp account to modify it.
The files are 0777 and your FTP-client can't modify those files?
Sorry, usually I create files by php script are '644', And I can't use ftp to delete it.

Re: user group problem on Linux + Apache

Posted: Sun Sep 27, 2009 4:38 am
by kaisellgren
ctmaster wrote:
kaisellgren wrote:
ctmaster wrote:And if I change a folder to '777', so I can modify it and create files in it, but I can't use ftp account to modify it.
The files are 0777 and your FTP-client can't modify those files?
Sorry, usually I create files by php script are '644', And I can't use ftp to delete it.
Ok, that makes sense. 0644 means that only the owner of the file (the one who created it) has rights to modify it. Try to CHMOD it to 0664 or 0666 or change the owner with CHOWN.

Re: user group problem on Linux + Apache

Posted: Mon Sep 28, 2009 8:53 pm
by ctmaster
So, thanks Kai.

But I have to know how can I use php script to get the purview, under '755' to modify the files and folders.

Re: user group problem on Linux + Apache

Posted: Tue Sep 29, 2009 12:31 am
by kaisellgren
ctmaster wrote:So, thanks Kai.

But I have to know how can I use php script to get the purview, under '755' to modify the files and folders.
chmod()/chown()?

Re: user group problem on Linux + Apache

Posted: Tue Sep 29, 2009 1:09 pm
by VladSun