Jump to content

Unable to mkdir ?permissions?


cclough

Recommended Posts

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....Please help!

Link to comment
Share on other sites

Does /site_root/data exist already?

 

If so, the directory strcuture might not be what you think it is. Just cus it shows up in your FTP client as /site_root/data/, that isn't always the true path. Use the following code to see if the path is what you think it is:

<?php echo 'This dir: '.dirname(__FILE__); ?>

The above will give you the directory of the PHP file that contains the code.

 

If /site_root/data/test does not exist, and you want to recursively make the directories, use:

 

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.