How does include path resolution work in require_once?
I was writing an web app in PHP, when I encountered a strange situation. To illustrate my problem, consider a web app of this structure: / index.php f1/ f1.php f2/ f2.php Contents of these files: index.php: <?php require_once("f1/f1.php"); ?> f1.php: <?php require_once("../f2/f2.php"); ?> f2.php: blank now when I try to open index.php in my browser I get this error: Warning: require_once(../f2/f2.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/reqtest/f1/f1.php on line 2 Fatal error: require_once() [function.require]: Failed opening required '../f2/f2