|PHP mkdir(), chmod() and Windows||#1|
I am using the PHP function mkdir($path, 0777) to create a new directory on an Apache server (running on Windows).
When I create this and view the folders, Windows has set the dir as read only. Is there a way of changing this without using exec() to cacls.exe? The PHP documentation states that chmod() doesn(t work on Windows but doesn(t say anything about a replacement method.
Google seems to be a little unhelpful on this one.
EDIT: After several minutes talking to administrators at my two-bit educational institution, it seems that their test PHP server for students is being run off of a USB drive. I have a feeling that this will have something to do with it slaps head
posted date: 2009-04-11 03:22:00
|Re: PHP mkdir(), chmod() and Windows||#3|
<?phpmkdir( "foo" )?>
(note no mode specified) works for me on Win2K - it creates a folder with no attributes set.Edit: Just had a thought - could it be something to do with permissions? Try running the above code from the command line & see what happens:
C:> c:\php\pgp.exe <?php mkdir( "foo" ) ?> ^Z
posted date: 2009-04-11 03:44:00
|Re: PHP mkdir(), chmod() and Windows||#4|
Note that chmod doesn't work on windows because windows uses a different method of permissions to linux.
posted date: 2009-04-11 03:47:00
|Re: PHP mkdir(), chmod() and Windows||#5|
According to the PHP documentation, the mode parameter is completely ignored on Windows (but defaults to 0777, so you wouldn(t have to specify it anyhow). Try not specifying the mode at all and see what happens. Maybe it messes something up?
posted date: 2009-04-11 03:51:00
|Re: PHP mkdir(), chmod() and Windows||#6|
I'm on WinXP and it hasn't worked for me. It creates a dir called foo, but the read only tag is ticked (and greayed out too!)
posted date: 2009-04-11 04:03:00
|Re: PHP mkdir(), chmod() and Windows||#7|
Also, I'm testing on PHP Version 5.2.4 on an Apache/2.2.0 (Win32) server. Unfortunately, I cannot change either of these.
posted date: 2009-04-11 04:07:00
|Re: PHP mkdir(), chmod() and Windows||#8|
Yes, I'm looking for a way to replicate the functionality of chmod() on windows :)
posted date: 2009-04-11 04:08:00
|Re: PHP mkdir(), chmod() and Windows||#9|
I am using 5.2.3, Sorry I can't help any more. I did a bit of googling & couldn't find mention of the problem - problems with chmod() yes, but not mkdir()
posted date: 2009-04-11 04:25:00
Mirza Zeeshan BAig
|Re: PHP mkdir(), chmod() and Windows||#10|
i am using in php and cakephp for windows as mkdir(" my dir name ",0777,true);it is working fine for me.
posted date: 2010-05-07 06:56:00
|select page: « 1 »|