timlondon Posted July 15, 2006 Share Posted July 15, 2006 I have a script which succesfully changes the permission of jpg files and moves them to another folder. The strange thing is that even though the script works perfectly it gives me the following errors for each file moved:Warning: chmod(): Operation not permitted in...Warning: rename(...I don't understand why the error messages are being generated if the script works.Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/14672-file-permissions-mystery/ Share on other sites More sharing options...
hvle Posted July 15, 2006 Share Posted July 15, 2006 it meants the script does not work perfectly.You should aware that PHP run under user permission, so, since user can not change the file permission, php can't either. Quote Link to comment https://forums.phpfreaks.com/topic/14672-file-permissions-mystery/#findComment-58488 Share on other sites More sharing options...
timlondon Posted July 15, 2006 Author Share Posted July 15, 2006 So should I be concerned about this? After all, the script does its job and both changes the file permissions and moves it to another folder??? Quote Link to comment https://forums.phpfreaks.com/topic/14672-file-permissions-mystery/#findComment-58492 Share on other sites More sharing options...
hvle Posted July 15, 2006 Share Posted July 15, 2006 what exactly are you working on? I suppose some sort of file uploading mechanism.Normally, I'd set the permission for destination folder to world writable. Of course, no change need to make to source folder.So, that'd left you with 2 choices, should you set it to writable, or set it to writable, move the file, then set it back to readonly.easy choice would be set the folder to writable.the second choice need a little more work. The idea is using php to create a connection to your ftp server using your username and password. With this, you gain full access to your site, and you can change the destination folder to writable, move the file, then change back to readonly.I have worked on similar problem, and as far as I've known, there is no other way unless you have control over PHP installation. Quote Link to comment https://forums.phpfreaks.com/topic/14672-file-permissions-mystery/#findComment-58495 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.