PHP cannot verify if directory exists
Posted
by
ali
on Stack Overflow
See other posts from Stack Overflow
or by ali
Published on 2012-06-04T22:36:48Z
Indexed on
2012/06/04
22:40 UTC
Read the original article
Hit count: 195
php
I am going crazy with this one
I have this folders and files structure
- /
- /projects
- /mytest
- /install
- /index.php
- /product
- /install
- /mytest
- /resources
- /projects
So, inside my install/index.php file I am trying to verify if /product folder does exist. I know that the folder exists, but looks like PHP doesn't. My code:
if(file_exists('../../mytest/product') && is_dir('../../mytest/product')) {
echo 'Folder exists!';
} else {
echo 'PHP is blind or something!';
}
Maybe I am very tired, but I just cannot figure out what is wrong. Some rested minds here maybe will see the problem. Thanks!
© Stack Overflow or respective owner