yolop Posted December 17, 2009 Share Posted December 17, 2009 when i do this if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $files[$mone]=$file; $mone++; } } closedir($handle); } i got pendir() [function.opendir]: Unable to access [function.opendir]: failed to open dir: Permission denied in why? i have chmod of 777 of all the files and folder in this folder help please thank Quote Link to comment Share on other sites More sharing options...
teamatomic Posted December 17, 2009 Share Posted December 17, 2009 maybe try 755 or 666 HTH Teamatomic Quote Link to comment Share on other sites More sharing options...
yolop Posted December 17, 2009 Author Share Posted December 17, 2009 not work! Quote Link to comment Share on other sites More sharing options...
steveboj Posted December 17, 2009 Share Posted December 17, 2009 Since the opendir() is failing, have you checked your file path is correct? I always use an absolute path with $_SERVER["DOCUMENT_ROOT"] when using opendir(), e.g. $dir = $_SERVER["DOCUMENT_ROOT"] . "/my_folder/"; Quote Link to comment Share on other sites More sharing options...
yolop Posted December 17, 2009 Author Share Posted December 17, 2009 the part is ../../../../imap/*******/XXX/Maildir/new/ i think the part is corecct Quote Link to comment Share on other sites More sharing options...
steveboj Posted December 17, 2009 Share Posted December 17, 2009 the part is ../../../../imap/*******/XXX/Maildir/new/ i think the part is corecct That is a 'relative' path. Try using an 'absolute' path like I showed in my previous message. Quote Link to comment Share on other sites More sharing options...
yolop Posted December 17, 2009 Author Share Posted December 17, 2009 i cant $_SERVER["DOCUMENT_ROOT"] will show the public_html and i need the imap folder.... Quote Link to comment Share on other sites More sharing options...
yolop Posted December 17, 2009 Author Share Posted December 17, 2009 plesae? Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted December 17, 2009 Share Posted December 17, 2009 the error says you do not have permission on the folder, that means you won't be able to read from it, the reason even after setting it to 777 it won't work because the parent directory you might be not having permission to. Quote Link to comment Share on other sites More sharing options...
yolop Posted December 17, 2009 Author Share Posted December 17, 2009 SO HOW CAN I DO THIS ? Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted December 17, 2009 Share Posted December 17, 2009 which folder are you accessing where is it located, what type of server are you using ? more information would be helpful Quote Link to comment Share on other sites More sharing options...
yolop Posted December 17, 2009 Author Share Posted December 17, 2009 linux Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted December 17, 2009 Share Posted December 17, 2009 folder ? Quote Link to comment 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.