For instance, I have a simple include file that has a function:
function ViewInclude($file){
require_once $file.'.inc.php';
}
And, another file (say index.php) that uses the function:
require_once 'inc.php';
ViewInclude('header');
When the require
fails, Warning message is as:
Warning: require_once(header.inc.php): failed to open stream: No such file or directory in ..../tests/inc.php on line 4
Now, let us say, a few other files also include the inc.php
file. When require
fails, the error is at inc.php at some line.
Is there a way to know the actual file and line number that triggered the error? (I mean the point of include where error was originated. In above case something like: at index.php at line 62)