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 Link to comment https://forums.phpfreaks.com/topic/185444-error-with-opendir/ Share on other sites More sharing options...
teamatomic Posted December 17, 2009 Share Posted December 17, 2009 maybe try 755 or 666 HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/185444-error-with-opendir/#findComment-979038 Share on other sites More sharing options...
yolop Posted December 17, 2009 Author Share Posted December 17, 2009 not work! Link to comment https://forums.phpfreaks.com/topic/185444-error-with-opendir/#findComment-979068 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/"; Link to comment https://forums.phpfreaks.com/topic/185444-error-with-opendir/#findComment-979077 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 Link to comment https://forums.phpfreaks.com/topic/185444-error-with-opendir/#findComment-979082 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. Link to comment https://forums.phpfreaks.com/topic/185444-error-with-opendir/#findComment-979088 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.... Link to comment https://forums.phpfreaks.com/topic/185444-error-with-opendir/#findComment-979098 Share on other sites More sharing options...
yolop Posted December 17, 2009 Author Share Posted December 17, 2009 plesae? Link to comment https://forums.phpfreaks.com/topic/185444-error-with-opendir/#findComment-979130 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. Link to comment https://forums.phpfreaks.com/topic/185444-error-with-opendir/#findComment-979134 Share on other sites More sharing options...
yolop Posted December 17, 2009 Author Share Posted December 17, 2009 SO HOW CAN I DO THIS ? Link to comment https://forums.phpfreaks.com/topic/185444-error-with-opendir/#findComment-979139 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 Link to comment https://forums.phpfreaks.com/topic/185444-error-with-opendir/#findComment-979144 Share on other sites More sharing options...
yolop Posted December 17, 2009 Author Share Posted December 17, 2009 linux Link to comment https://forums.phpfreaks.com/topic/185444-error-with-opendir/#findComment-979146 Share on other sites More sharing options...
rajivgonsalves Posted December 17, 2009 Share Posted December 17, 2009 folder ? Link to comment https://forums.phpfreaks.com/topic/185444-error-with-opendir/#findComment-979148 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.