The hierarchy of my site is like this:
/
/webroot/
/webroot/index.php
/webroot/images/foo.jpg
I do not have write permissions for /
, but I do for anything within /webroot
.
Now say within index.php I have any of these commands:
var_dump(is_dir('./images/frontpage'));
var_dump(is_dir('images/frontpage'));
var_dump(is_dir('/webroot/images/frontpage'));
var_dump(is_dir('.\images\frontpage'));
They will all return false
. But if within webroot\index.php
I have...
var_dump(is_dir('../images'));
...they return true
. Am I missing something obvious? Is it supposed to work this way? I don't understand this.
BUT: If I have something like this:
/
/webroot/
/webroot/index.php
/webroot/images/foo.jpg
/webroot/subfolder/index.php
Then var_dump(is_dir('../images'));
will return true
both in index.php
and in subfolder/index.php