I have a directory layout something like /public_html/foo/bar.php that I want required in my file with my file require statement being currently require('../foo/bar.php') but I’m not getting to it (I keep getting an error saying its not a directory? and failed to open stream).
My file that I’m putting the require in is in /public_html/foo2/ so I need to go up one directory listing and then find the file to include it but I’m not sure what I’m doing wrong right now. Any guesses?
Actual code:
require('../objects/user.php/');
Thanks for your help!
You have a
/behind your../objects/user.phpsuggestinguser.phpis a directory.That’s why it tells you it is not a directory, because it indeed isn’t.
Remove it and you’ll probably be fine. (so
../objects/user.php/becomes../objects/user.php)