PHP mkdir(), chmod() and Windows

痞子三分冷 提交于 2019-11-28 14:03:26

The following:

<?php
mkdir( "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

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?

i am using in php and cakephp for windows as mkdir(" my dir name ",0777,true); it is working fine for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!