trillion Posted September 15, 2006 Share Posted September 15, 2006 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 666if (ftp_chmod($conn_id, 0666, $file) !== false) {echo "$file chmoded successfully to 666\n";} else {echo "could not chmod $file\n";}// close the connectionftp_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 Quote Link to comment Share on other sites More sharing options...
trillion Posted September 16, 2006 Author Share Posted September 16, 2006 I go chmod to work on files for both local server and remote server however I still need to find a script to chmod directoriesany sources will help thanks Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 16, 2006 Share Posted September 16, 2006 http://www.port80.asn.au/forums/viewtopic.php?t=1617&sid=0ec3c5f00daba2469d2913d567e9c1d3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.