mkdir issue with Windows Server 2003

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cclough
    New Member
    • Feb 2008
    • 2

    mkdir issue with Windows Server 2003

    Hello,

    I have run into a problem using the mkdir function on a windows 03 server running IIS v6 with PHP 5.0. I am trying to simply create a folder within my site. Safe Mode is set to "off" and the "everyone" group has full-control of the "data" folder and subfolders. My script is as follows:

    <?php
    if(mkdir("/site_root/data/test"))
    echo "TRUE";
    else
    echo "FALSE";
    ?>

    Always outputs "false", and of course the folder is not created....Plea se help!
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    Is Program Files part of the path name?
    Some PHP functions don't like spaces in directory names.
    Some also prefer the full path name.
    If the directory already exists Windows will deny mkdir, but not sure what is returned.
    A better test is to use mkdir without an if() then use
    [PHP]if(file_exists( $dirname))[/PHP]

    Comment

    • cclough
      New Member
      • Feb 2008
      • 2

      #3
      Thanks for your reply. However, I do not know what the parent directory of site_root is. I think it might have something to do with permissions though. The company hosting my site has set the everyone group with full control of the folder i am trying to add the directory, however i think they have done this with active directory. By granting permissions this way, would this also grant access it to allow the user that the script runs under to create directories? BTW what user would that be? Or, would this need to be set in th IIS manager? Thanks again for your help!!

      Comment

      • amanjsingh
        New Member
        • Mar 2007
        • 48

        #4
        Originally posted by cclough
        Thanks for your reply. However, I do not know what the parent directory of site_root is. I think it might have something to do with permissions though. The company hosting my site has set the everyone group with full control of the folder i am trying to add the directory, however i think they have done this with active directory. By granting permissions this way, would this also grant access it to allow the user that the script runs under to create directories? BTW what user would that be? Or, would this need to be set in th IIS manager? Thanks again for your help!!
        I have had this problem too but I could not find any solution. I always had asked this question that if a script is trying to output a file or directory what user would that be? So, that I can give that user permissions etc to do this.

        Somehow my script has started working fine and I feel that if you set the particular directory settings to all permissions then it gets better.

        Also, please note that I had to put the complete URL that is from C:\xxx\ggg\ etc

        Comment

        • nomad
          Recognized Expert Contributor
          • Mar 2007
          • 664

          #5
          Originally posted by amanjsingh
          I have had this problem too but I could not find any solution. I always had asked this question that if a script is trying to output a file or directory what user would that be? So, that I can give that user permissions etc to do this.

          Somehow my script has started working fine and I feel that if you set the particular directory settings to all permissions then it gets better.

          Also, please note that I had to put the complete URL that is from C:\xxx\ggg\ etc
          bing go:
          C:\xxx\ggg\ etc

          nomad

          Comment

          Working...