suttercain Posted May 2, 2007 Share Posted May 2, 2007 Hi guys, I have the includes of my file in the root directory and able to access the with no problem if I have a file located beneath that directory: EXAMPLE: <?php include('../header.php') //This works from with the .php file in the www.domain.com/collectibles/ directory ?> But I am unable to access the include files if I go two directories beneath: EXAMPLE 2: <?php include('../header.php') //This DOES NOT WORK from with the .php file in the www.domain.com/collectibles/actionFigures directory ?> With EXAMPLE 2 I get this error: Warning: include(../header.php) [function.include]: failed to open stream: No such file or directory in /home/superman/public_html/collectibles/actionFigures/index.php on line 10 Warning: include(../header.php) [function.include]: failed to open stream: No such file or directory in /home/superman/public_html/collectibles/actionFigures/index.php on line 10 Warning: include() [function.include]: Failed opening '../header.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/superman/public_html/collectibles/actionFigures/index.php on line 10 How do I rectify this issue? Thanks for the help! Link to comment https://forums.phpfreaks.com/topic/49699-solved-include-path-question/ Share on other sites More sharing options...
papaface Posted May 2, 2007 Share Posted May 2, 2007 its best to use full paths for includes I find. So your includes should be: <?php include('/home/superman/public_html/collectibles/header.php'); ?> Link to comment https://forums.phpfreaks.com/topic/49699-solved-include-path-question/#findComment-243687 Share on other sites More sharing options...
suttercain Posted May 2, 2007 Author Share Posted May 2, 2007 I am still getting the include error in my first post. If the header.php is actually located at /home/superman/public_html/header.php' I would point it to /home/superman/public_html/collectibles/header.php' ? Link to comment https://forums.phpfreaks.com/topic/49699-solved-include-path-question/#findComment-243692 Share on other sites More sharing options...
suttercain Posted May 2, 2007 Author Share Posted May 2, 2007 This worked: <?php include ('/home/superman/public_html/header.php'); ?> Link to comment https://forums.phpfreaks.com/topic/49699-solved-include-path-question/#findComment-243702 Share on other sites More sharing options...
papaface Posted May 2, 2007 Share Posted May 2, 2007 Thats what I meant. Link to comment https://forums.phpfreaks.com/topic/49699-solved-include-path-question/#findComment-243704 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.