Darklink Posted July 21, 2008 Share Posted July 21, 2008 I know Windows does not support CHMOD. I've looked around to find out if there is an ftp_site command or something that can still edit the permissions for a Windows file and/or directory. Does anyone know of any commands or methods that can change the permission attributes? Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/ Share on other sites More sharing options...
samshel Posted July 21, 2008 Share Posted July 21, 2008 Sorry Dark link but this is not PHP related, you may well get good answers in a relevant forum... Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595441 Share on other sites More sharing options...
Darklink Posted July 21, 2008 Author Share Posted July 21, 2008 No I mean in PHP. ftp_site() is a PHP function. I've seen no support for changing permissions for Windows files and directories in PHP. Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595444 Share on other sites More sharing options...
samshel Posted July 21, 2008 Share Posted July 21, 2008 ow..sorry for misunderstanding..i dont have a clue, may be some one else can help. Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595447 Share on other sites More sharing options...
MadTechie Posted July 21, 2008 Share Posted July 21, 2008 Theirs a few but changing permission via the FTP protocal is the best probably the option, you could use a "Program execution Functions" and set them via a command line.. Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595462 Share on other sites More sharing options...
Darklink Posted July 21, 2008 Author Share Posted July 21, 2008 I would like to do this automatically. Most FTP software do not support the changing of permissions on Windows. You have to actually remotely access the server and change the attributes from there on in, which is a pain. I need to know of a command that I could use with an ftp command function such as ftp_site() which allows me to do this. Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595466 Share on other sites More sharing options...
trq Posted July 21, 2008 Share Posted July 21, 2008 Does ftp_chmod help? Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595471 Share on other sites More sharing options...
Darklink Posted July 21, 2008 Author Share Posted July 21, 2008 No. As I've said, CHMOD is not supported by Windows (although I have been aware that in some cases people have gotten some things to work with CHMOD but it's incredibly unstable). Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595472 Share on other sites More sharing options...
MadTechie Posted July 21, 2008 Share Posted July 21, 2008 Does ftp_chmod help? No. As I've said, CHMOD is not supported by Windows (although I have been aware that in some cases people have gotten some things to work with CHMOD but it's incredibly unstable). Erm.. ftp_chmod is not chmod its ftp_chmod they are not the same ftp_chmod runs vai the ftp protocal, which is the same as remotely access the server and change the attributes from there on in, which is the command you asked for I need to know of a command that I could use with an ftp command function such as ftp_site() which allows me to do this. Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595485 Share on other sites More sharing options...
Darklink Posted July 21, 2008 Author Share Posted July 21, 2008 I'm not talking about the chmod() function. I'm talking about CHMOD in general. FTP Protocols will still not work CHMOD for Windows. Windows has a different way of working with permissions. Therefore ftp_chmod() will not work either. There has to be a command line to be able to change the permissions. But I'm not able to find a solution to this. Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595490 Share on other sites More sharing options...
Darklink Posted July 21, 2008 Author Share Posted July 21, 2008 Actually, let me correct myself. Windows does do CHMOD, but it works differently to Linux and Mac. But to make it clear, both chmod and ftp_chmod do not work with Windows as far as I have seen. Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595491 Share on other sites More sharing options...
redarrow Posted July 21, 2008 Share Posted July 21, 2008 in a windows env you have to set folder and file permissions via the op system that it.... any command u use within the php env will work...................... Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595495 Share on other sites More sharing options...
Darklink Posted July 21, 2008 Author Share Posted July 21, 2008 So there is no possible way with PHP to be able to do it? Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595498 Share on other sites More sharing options...
MadTechie Posted July 21, 2008 Share Posted July 21, 2008 ftp_chmod works fine on a windows server running filezilla server! If you apache needs to follow these permissions then your need to use a program execution function, and probably change the user that the apache service uses, may i ask what your trying to do ? Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595499 Share on other sites More sharing options...
Darklink Posted July 21, 2008 Author Share Posted July 21, 2008 All I'm doing is creating directories and then setting the permissions equivalent to 0777 to those new directories. So users can upload images to their directories. It would just save time if staff members didn't have to set the permissions of every folder manually. Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595508 Share on other sites More sharing options...
redarrow Posted July 21, 2008 Share Posted July 21, 2008 so tell the scrpit if a file is created then set the permission to 0777 Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595510 Share on other sites More sharing options...
MadTechie Posted July 21, 2008 Share Posted July 21, 2008 or just change the windows permissions to everyone Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595511 Share on other sites More sharing options...
Darklink Posted July 21, 2008 Author Share Posted July 21, 2008 But the whole point of this thread is to find out if I can do this automatically rather than manually. :-\ Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595515 Share on other sites More sharing options...
MadTechie Posted July 21, 2008 Share Posted July 21, 2008 If you apache needs to follow these permissions then your need to use a program execution function, and probably change the user that the apache service uses, Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595522 Share on other sites More sharing options...
Darklink Posted July 21, 2008 Author Share Posted July 21, 2008 Unfortunately I'm using IIS. Don't ask why. I wanted to use Apache but the company decided IIS on Windows Server 2003 is the best solution. *rolls eyes* Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595524 Share on other sites More sharing options...
MadTechie Posted July 21, 2008 Share Posted July 21, 2008 same rules should apply, infact doesn't IIS have user and group controls (no idea is they affect tomcat) either way.. changing the user that the service uses or changing the rights of that user should resolve the issule. Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595526 Share on other sites More sharing options...
Darklink Posted July 21, 2008 Author Share Posted July 21, 2008 Do you mean changing the rights of the user for the directory above all new directories? Because I've already tried that. Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595539 Share on other sites More sharing options...
MadTechie Posted July 21, 2008 Share Posted July 21, 2008 Yes, thats what i mean, make sure its the correct user account see here, Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595547 Share on other sites More sharing options...
Darklink Posted July 21, 2008 Author Share Posted July 21, 2008 I'm trying to test setting the permissions in Windows but the only group that won't apply is the CREATOR OWNER group. Which seems like it could be causing the problem. Seems strange as the settings were applied in the past but must of reset for some reason. Do you know why it won't apply the settings? Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595557 Share on other sites More sharing options...
MadTechie Posted July 21, 2008 Share Posted July 21, 2008 Humm are the permission setting them selfs to nothing and are you using Vista/Longhorn by any chance ? you could try resetting the ACL (access control list) **WARNING** take note of the permissions first.. this may not work icacls c:\path\to\www /grant Users:(CI)(S,WD,AD,X) icacls c:\path\to\www /grant "CREATOR OWNER":(OI)(CI)(IO)(F) Note that CREATOR OWNER is granted ownership icacls info Quote Link to comment https://forums.phpfreaks.com/topic/115829-windows-and-permissions/#findComment-595982 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.