
Originally Posted by
dkroll
Liam,
I tried to do chmod ("path", 0777);, but I get an error:
"Warning: chmod() [function.chmod]: Operation not permitted in myphpfile.php line 99"
Sounds like a problem I had ...
In Linux your php daemon isn't always the same (nor in the same group) as the ftp daemon ...
This is why if you have a script do actions on files and dirs the rights have to be set at 777 or the folder needs to be created using the php-daemon
complex... lets i.e.
i logged on to the server using ftp and created folder x this makes the user running ftp the owner of the folder ...
If I have php and let that create a folder y then the daemon running php will be the owner for folder y and I won't be able to control the properties nor delete it using ftp...
wanna set the chmod using ftp functions??
PHP Code:
// set up basic connection
$conn_id = ftp_connect($ftpadres);
// login with username and password
$login_result = ftp_login($conn_id, $ftplogin, $ftppassword);
// php(ftp) command for chmod
ftp_site($conn_id, "chmod 777 $target");
I hope it helps ...
Bookmarks