0

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!

1
  • 4
    Lose the slash after the php at the end of the filename. Commented May 17, 2012 at 23:05

1 Answer 1

2

You have a / behind your ../objects/user.php suggesting user.php is 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)

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! That was totally it, upvote for the added description of the exact issue!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.