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! 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? 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"; ?> 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. Link to comment https://forums.phpfreaks.com/topic/89602-unable-to-mkdir-permissions/#findComment-459098 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.