Jessica Posted February 21, 2007 Share Posted February 21, 2007 <?php print $moveTo; if(!is_dir($moveTo)){ if(!mkdir($moveTo)){ // 153 return false; } }?> I get: /home/mysite/folder/ Warning: mkdir() [function.mkdir]: No such file or directory in /home/mysite/functions.php on line 153 When it's /home/mysite/folder it still doesn't work. Ideas? Quote Link to comment https://forums.phpfreaks.com/topic/39431-mkdir-no-such-file/ Share on other sites More sharing options...
usapphire Posted February 21, 2007 Share Posted February 21, 2007 This may sound silly.. but is the folder CHMOD to 777? Since it's moving a file into the folder, you'll need to CHMOD it for access... Quote Link to comment https://forums.phpfreaks.com/topic/39431-mkdir-no-such-file/#findComment-190246 Share on other sites More sharing options...
Jessica Posted February 21, 2007 Author Share Posted February 21, 2007 777 is default. I can't create the folder, so how can I CHMOD it? Actually, this is weirder - the folder already exists, so it shouldn't be trying to mkdir it - it's like it can't see $moveTo in the is_dir and mkdir commands...but I can print it out right before. Quote Link to comment https://forums.phpfreaks.com/topic/39431-mkdir-no-such-file/#findComment-190248 Share on other sites More sharing options...
usapphire Posted February 21, 2007 Share Posted February 21, 2007 777 is default. I can't create the folder, so how can I CHMOD it? Actually, this is weirder - the folder already exists, so it shouldn't be trying to mkdir it - it's like it can't see $moveTo in the is_dir and mkdir commands...but I can print it out right before. I'm sorry, I'm not very PHP-logic.. Maybe someone else can help? Sorry.. Quote Link to comment https://forums.phpfreaks.com/topic/39431-mkdir-no-such-file/#findComment-190252 Share on other sites More sharing options...
effigy Posted February 21, 2007 Share Posted February 21, 2007 What are the owner/group/permissions of /home/mysite/? Quote Link to comment https://forums.phpfreaks.com/topic/39431-mkdir-no-such-file/#findComment-190256 Share on other sites More sharing options...
Jessica Posted February 21, 2007 Author Share Posted February 21, 2007 If it was a permissions issue, wouldn't I get a permissions error? Instead it's acting like the folder doesn't exist when it does. All the folders are 777. Well it didn't like me using the whole path...if I just do 'folder' it works, but not '/home/mysite/folder'; Quote Link to comment https://forums.phpfreaks.com/topic/39431-mkdir-no-such-file/#findComment-190259 Share on other sites More sharing options...
tom100 Posted February 21, 2007 Share Posted February 21, 2007 Try removing the / at the beginning of the string, I've had problems like this and for whatever reason that / killed it. So instead of: /home/mysite/folder/ Try: home/mysite/folder/ Quote Link to comment https://forums.phpfreaks.com/topic/39431-mkdir-no-such-file/#findComment-190261 Share on other sites More sharing options...
Jessica Posted February 21, 2007 Author Share Posted February 21, 2007 To me, that indicates that it will be the current path + that, so if just "folder" creates a folder at /home/mysite/folder/, won't that make "/home/mysite/home/mysite/folder/" ? Is this some kind of ini setting or something? I just recently changed the site from php4 to php5 also... Quote Link to comment https://forums.phpfreaks.com/topic/39431-mkdir-no-such-file/#findComment-190262 Share on other sites More sharing options...
tom100 Posted February 21, 2007 Share Posted February 21, 2007 That's true. If you try just using "folder" as the string, does that work? Quote Link to comment https://forums.phpfreaks.com/topic/39431-mkdir-no-such-file/#findComment-190269 Share on other sites More sharing options...
Jessica Posted February 21, 2007 Author Share Posted February 21, 2007 if I just do 'folder' it works, but not '/home/mysite/folder'; :-P Quote Link to comment https://forums.phpfreaks.com/topic/39431-mkdir-no-such-file/#findComment-190271 Share on other sites More sharing options...
tom100 Posted February 21, 2007 Share Posted February 21, 2007 Doh, sorry. Ok, so what is PHP seeing the root dir as now that you've upgraded? print_r($_SERVER); Quote Link to comment https://forums.phpfreaks.com/topic/39431-mkdir-no-such-file/#findComment-190277 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.