anche questo l'ho cercato sul manuale ed ho trovato questo

If you get a warning like chmod(): Operation not permitted in /home/folder/public_html/admin/includefiles/fileupload.php on line 24

You can use the ftp_site() function to send a CHMOD command through.

Codice PHP:
<?php

$ftp_details
['ftp_user_name'] = $row['username'];
$ftp_details['ftp_user_pass'] = $row['password'];
$ftp_details['ftp_root'] = '/public_html/';
$ftp_details['ftp_server'] = 'ftp'.$_SERVER['HTTP_HOST'];

function 
chmod_11oo10($path$mod$ftp_details)
{
    
// extract ftp details (array keys as variable names)
    
extract ($ftp_details);
    
    
// set up basic connection
    
$conn_id ftp_connect($ftp_server);
    
    
// login with username and password
    
$login_result ftp_login($conn_id$ftp_user_name$ftp_user_pass);
    
    
// try to chmod $path directory
    
if (ftp_site($conn_id'CHMOD '.$mod.' '.$ftp_root.$path) !== false) {
        
$success=TRUE;
    } 
    else {
        
$success=FALSE;
    }

    
// close the connection
    
ftp_close($conn_id);
    return 
$success;
}
?>