Jump to content

Archived

This topic is now archived and is closed to further replies.

trillion

chmod() not working

Recommended Posts


I can get this to work on files but not directories on my local server. Then it doesn't even work on files when I upload it to a remote server. I have not had success at all with the ftp method but I have been successful with other PHP/ftp functions.

What do I need to do different?
my code looks something like this:


chmod(/home/user/public_html/file.php, 0666);

and I get this:

Warning: chmod(): Operation not permitted in /home/user/public_html/chmod.php on line #


I also have tried this:

$ftp_user_name = "user";
$ftp_user_pass = "pass";
$ftp_server = "localhost";
$file = 'public_html/file.php';

// 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 $file to 666
if (ftp_chmod($conn_id, 0666, $file) !== false) {
echo "$file chmoded successfully to 666\n";
} else {
echo "could not chmod $file\n";
}

// close the connection
ftp_close($conn_id);



and I get this:

Fatal error: Call to undefined function: ftp_chmod() in /home/inherent/public_html/Promote Musicians/codibot.php on line 47

Share this post


Link to post
Share on other sites
I go chmod to work on files for both local server and remote server however I still need to find a script to chmod directories

any sources will help

thanks

Share this post


Link to post
Share on other sites
http://www.port80.asn.au/forums/viewtopic.php?t=1617&sid=0ec3c5f00daba2469d2913d567e9c1d3

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.