Hello, I am trying to write an installation module for a script that I wrote to allow the user to install my script without having to do any coding and working on the server...
I wrote this function:
function tbs_chmod($path) {
global $tbs_install_folder;
if ( chmod($path,0777) )
return $path.' successfully chmodded.<br />';
else
return $path.' needs to be chmodded 777 (now it is '.fileperms($path).')<br />';
}
echo tbs_chmod($_SERVER['DOCUMENT_ROOT'].'/tbs/userfiles/image');
but all I get is:
Warning: chmod() [function.chmod]: Operation not permitted in /home/eastside/public_html/tbs/install.php on line 10
/home/eastside/public_html/tbs/userfiles/image needs to be chmodded 777 (now it is 16877)
Am I doing something wrong? Why is the operation not permitted? And why is it saying that that folder is set to permissions 16877 even though my FTP software says it is set to 755?
Thanks