Page 1 of 1

Changing the Permission of the file

Posted: Fri Aug 03, 2007 2:59 am
by ajaymallaya
Hello,

I need to change the permission, group and owner of a file dynamically using php in a linux platform. Please let me know what is the best solution. Whether to use chmod(), chgrp() functions or the php_exec() and directly give unix commands in it.

Thanks in advance,

Ajay

Posted: Fri Aug 03, 2007 1:20 pm
by dude81
chmod and chown are good enough

Posted: Fri Aug 03, 2007 1:24 pm
by Chris Corbyn
Bear in mind that if these functions are to work you *need permission to change the permissions* if that makes sense. i.e. If the files were created by FTP, and PHP/Apache is not running under your own userid then you may struggle.

Is chmod secure enough????

Posted: Mon Aug 06, 2007 5:36 am
by ajaymallaya
hi,

Thanks for the reply. My userID is having enough permission to change the permission of the files.

But one questions... Is there any security risk / concrens for using this methods?

Or I will put it in this way, what are the things which we should keep in mind while using these functions/ methods?

Thanks again for you reply,

regards,

Ajay