Jump to content

How does this relative path resolve?


ShadowMage

Recommended Posts

Having some issues with require paths and I just want some clarification. I know how I think this should work, but it doesn't make any sense. How would the following path resolve:/usr/local/www/htdocs/majorsky/htdocs/../lib The path is invoked from:/usr/local/www/htdocs/majorsky/htdocs/webspace

Link to comment
Share on other sites

Ok, that's what I thought. The reason I'm asking is because the web host for our company website is migrating to a new server and they made some directory structure changes that broke the website. So I'm trying to figure out what the heck is going on and how to fix it (I didn't write the website so it's...difficult...to say the least). Anyway, with your confirmation, I just had an epiphany. I had thought that the above didn't make sense, because it didn't match up with the directory structure on the old server, but then I realized that the file path I posted was taken from the error message that was thrown out on the new server. So of course it wouldn't match the structure on the old one! :facepalm: Once I got the file structures straightened out and using the right one on the right server, everything started making sense. ^_^Thanks for the confirmation and the nudge in the right direction, Ingolme!

Link to comment
Share on other sites

For future reference's sake - if a path starts with "/", under UNIX, it will always be relative to the root, regardless of your CWD.That being said, some applications might treat "the root" as something other than the OS' root, but if that's so, they'll explicitly clarify it. PHP doesn't do that though... Apache sort of does it (paths without quotes that start with "/" are relative to the "ServerRoot").

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...