Garethp Posted October 18, 2009 Share Posted October 18, 2009 Ok, so for some reason when I use include "/Navigation.php"; It comes back with Warning: include(/Navigation.php) [function.include]: failed to open stream: No such file or directory in /home/parkerco/public_html/Portfolio/innorvarite.php on line 25 Now, Navigation.php is at the root folder (public_html) and I'm trying to call it from any folder. How can I just make it an absolute without using http://parkercodes.com? I thought in absolute paths, putting / at the front meant root directory Quote Link to comment https://forums.phpfreaks.com/topic/178097-including-a-file-in-the-root-directory/ Share on other sites More sharing options...
Daniel0 Posted October 18, 2009 Share Posted October 18, 2009 If Navigation.php is in a folder called public_html, then it is per definition not in the root folder... Quote Link to comment https://forums.phpfreaks.com/topic/178097-including-a-file-in-the-root-directory/#findComment-939059 Share on other sites More sharing options...
Kaboom Posted October 18, 2009 Share Posted October 18, 2009 use: "../Navigation.php" you need two dots to reference parent Quote Link to comment https://forums.phpfreaks.com/topic/178097-including-a-file-in-the-root-directory/#findComment-939061 Share on other sites More sharing options...
Garethp Posted October 18, 2009 Author Share Posted October 18, 2009 If Navigation.php is in a folder called public_html, then it is per definition not in the root folder... I thought that in web directories the folder that is in the top level of the domain is considered the parent. IE, where parkercodes.com/index.php resides. Or is that only for HTML and Javascript? Quote Link to comment https://forums.phpfreaks.com/topic/178097-including-a-file-in-the-root-directory/#findComment-939065 Share on other sites More sharing options...
Daniel0 Posted October 18, 2009 Share Posted October 18, 2009 That's only on the client side unless your server is chroot'ed. The root directory on a file system is always the top-most folder because of the tree like structure a filesystem is organized in. Quote Link to comment https://forums.phpfreaks.com/topic/178097-including-a-file-in-the-root-directory/#findComment-939068 Share on other sites More sharing options...
Kaboom Posted October 18, 2009 Share Posted October 18, 2009 using <?php include "../Navigation.php"; ?> will work try it Quote Link to comment https://forums.phpfreaks.com/topic/178097-including-a-file-in-the-root-directory/#findComment-939069 Share on other sites More sharing options...
Garethp Posted October 18, 2009 Author Share Posted October 18, 2009 That's only on the client side unless your server is chroot'ed. The root directory on a file system is always the top-most folder because of the tree like structure a filesystem is organized in. Cool, thanks for the info. And I know about that Kaboom. I just wanted to know how to do root, not parent. Just an addition of knowledge. Daniel0 fueled that expedition of knowledge Quote Link to comment https://forums.phpfreaks.com/topic/178097-including-a-file-in-the-root-directory/#findComment-939080 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.