2

I am using Filezilla for accessing my website files.But some files/folders permissions are not allowing to change in FTP.because their owner and group name is different (i.e apache/apache).So I want to change it from apache/apache to xyz/abc.Any helps ?

Thanks

Ashish
  • 174
  • 2
  • 13

2 Answers2

1

Try using chown function provided in php http://php.net/manual/en/function.chown.php

  • It does't work, because it applies to a file, not to a directory, to read the documentation – Brian May 17 '17 at 22:31
1

You can use the chown php command for this:

bool chown ( string $filename , mixed $user )

$filename is the path to the filename $user is the user name or id This function returns false, if the operation is not successful.

More info :

You can read more about this function here:

http://php.net/manual/en/function.chown.php

Couple remarks:

  • You can't change the owner if you don't have permissions for that
  • Some servers will not allow execution by Apache, if the file's owner is different than the Apache user
beerwin
  • 9,813
  • 6
  • 42
  • 57
  • Thank you for your reply.But I have a root access.Still it not allow me to change permissions ? – Ashish Jul 01 '15 at 13:12
  • If you have root access, that doesn't mean that the Apache/PHP stack has it too (that would be a very bad practice anyway). – beerwin Jul 02 '15 at 09:08
  • So what will be the resolution for this ?How I can change permission ? – Ashish Jul 02 '15 at 18:11