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
https://forums.phpfreaks.com/topic/89602-unable-to-mkdir-permissions/
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";
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.