PHP mkdir (), chmod () and Windows

I am using the PHP function mkdir ($ path, 0777) to create a new directory on the Apache server (works on Windows).

When I create this and browse the folders, Windows installed dir as read-only. Is there a way to change this without using exec () for cacls.exe? The PHP documentation states that chmod () does not work on Windows, but says nothing about the replacement method.

Google seems a little useless on this.

EDIT: After a few minutes, talking with administrators at my two-bit school, it seems like their test PHP server for students is running from a USB drive. I have a feeling that this will have something to do with him.

+3
source share
3 answers

Following:

<?php
mkdir( "foo" )
?>

(note that no mode is specified) works for me on Win2K - it creates a folder without attributes.

Edit: Just thought - maybe it's related to permissions? Try running the above code from the command line and see what happens:

C:> c:\php\pgp.exe
    <?php
    mkdir( "foo" )
    ?>
    ^Z
+2
source

According to the PHP documentation, the mode parameter is completely ignored on Windows (but the default is 0777, so you won’t need to specify it anyway). Try not to specify a mode at all and see what happens. Maybe it ruined something?

+1
source

php cakephp windows mkdir ( "my dir name", 0777, true); .

+1

Source: https://habr.com/ru/post/1706267/


All Articles