cclough Posted February 5, 2008 Share Posted February 5, 2008 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! Quote Link to comment https://forums.phpfreaks.com/topic/89602-unable-to-mkdir-permissions/ Share on other sites More sharing options...
revraz Posted February 5, 2008 Share Posted February 5, 2008 Have you checked your error logs? Quote Link to comment https://forums.phpfreaks.com/topic/89602-unable-to-mkdir-permissions/#findComment-459054 Share on other sites More sharing options...
rhodesa Posted February 5, 2008 Share Posted February 5, 2008 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"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/89602-unable-to-mkdir-permissions/#findComment-459061 Share on other sites More sharing options...
ratcateme Posted February 5, 2008 Share Posted February 5, 2008 try using a full path like this <?php if(mkdir(dirname(__FILE__)."/site_root/data/test")) echo "TRUE"; else echo "FALSE"; ?> Scott. Quote Link to comment https://forums.phpfreaks.com/topic/89602-unable-to-mkdir-permissions/#findComment-459098 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.