It's normal that I get a PHP warning trying to include_once the same file twice.
The first include_once properly loads the PHP file. The second include_once with the same file obviously gives me an error.
My question is why am I getting a "Warning: include_once(../../config.php): failed to open stream: No such file or directory in ..."
and a "Warning: include_once(): Failed opening ..."
when the file clearly exists.
I'm just curious as to why PHP wouldn't tell me something like "file already included" or something, but instead says the file doesn't exist.
My structure: I have a page with internal navigation using jQuery .load().
The initial page is loaded like this:
<?php
include_once("header.php");
if ($sessid === $idn) include_once("components/activity_feed.php");
else { include_once("components/my_textbooks.php");}
include_once("footer.php");
?>
header.php contains an include_once to ../config.php for server conf.
components/activity_feed.php also includes an include_once to ../../config.php, so when components/my_textbooks.php is requested via .load() the config file is loaded and the page is rendered before being served.