example1.php has simple: require_once("../item.php");
Typical error: Warning: require_once(../item.php): failed to open stream: No such file or directory in /opt/lampp/htdocs/sub/sub/example1.php on line 3
Fatal error: require_once(): Failed opening required '../item.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/sub/sub/example1.php on line 3
Yes, that file is there. It’s just one layer above, no finnicky stuff.
The permissions are -rw-rw-r--, triple read.
Require command is used in first line of actual code.
I’m not sure that the ../ syntax works in php, I think it’s just an html thing.
Try using $_SERVER["DOCUMENT_ROOT"] .' /restOfPath/' or the full path from the root.
JFYI ../ syntax works for PHP, C++, Bash, Linux, Windows, Mac and probably any other computer system in the world that works with filesystem-like hierarchy.
The only problem with it is that it’s being a relative address, and thus less reliable than absolute path you suggested.