themuffin Posted April 23, 2009 Share Posted April 23, 2009 Warning: main(/fab/header.php) [function.main]: failed to open stream: No such file or directory in (there is the rest of the path here) html/fab/content1.php on line 7 Warning: main(/fab/header.php) [function.main]: failed to open stream: No such file or directory in (there is the rest of the path here) html/fab/content1.php on line 7 Fatal error: main() [function.require]: Failed opening required '/fab/header.php' (include_path='.:/usr/local/lib/php') in (there is the rest of the path here)/html/fab/content1.php on line 7 The above is the message I get.. what do I need to change? Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/ Share on other sites More sharing options...
Maq Posted April 23, 2009 Share Posted April 23, 2009 Can we see the relative code? Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817316 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 require('../includes/header.php'); require('../includes/main_menu.php'); require('../includes/footer.php'); require('../includes/template.php'); I hope that;s what you asked for I am like .. crazy NEW at this.. and thanks I don't think the path? is right Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817317 Share on other sites More sharing options...
revraz Posted April 23, 2009 Share Posted April 23, 2009 Check your server to see if those paths are right? Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817325 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 that's actually the problem.. I don't know the proper way to write the path.. perhaps that should be what I was asking.. I'm getting in way over my head I know, but I have a few other pages I have made with no problem.. I used include instead of require.. Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817340 Share on other sites More sharing options...
revraz Posted April 23, 2009 Share Posted April 23, 2009 Show us your folder structure, starting from your webroot folder. Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817346 Share on other sites More sharing options...
Maq Posted April 23, 2009 Share Posted April 23, 2009 Well say the file you're calling the requires is in: /usr/local/blah.com/main/current_page.php Now when you call, "../includes" it goes back a dir, and into include. So now we're in: /usr/local/blah.com/main/includes Then in that directory you're looking for "header.php". Is that where it is, relatively? Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817351 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 yes Maq that is where it is -in includes I thought when I uploaded the files to the remote server that I was putting them in the right place.. SO from the old error : Fatal error: main() [function.require]: Failed opening required 'http://feelingabsolutelyfabulous.com/includes/header.php' (include_path='.:/usr/local/lib/php') should I put the includes in the php folder? as above? Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817358 Share on other sites More sharing options...
Maq Posted April 23, 2009 Share Posted April 23, 2009 should I put the includes in the php folder? as above? No muffin. Can you post the FULL path to the include file, and the FULL path of the PHP file you're calling it from? Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817361 Share on other sites More sharing options...
nankoweap Posted April 23, 2009 Share Posted April 23, 2009 assuming your paths relative from the document root are correct, consider something like: include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'); include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/main_menu.php'); include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'); include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/template.php'); jason Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817365 Share on other sites More sharing options...
revraz Posted April 23, 2009 Share Posted April 23, 2009 Show us your folder structure, starting from your webroot folder. Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817368 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 assuming your paths relative from the document root are correct, consider something like: include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'); include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/main_menu.php'); include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'); include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/template.php'); Warning: main(/home/content/s/c/t/sctfaery/html/includes/header.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 7 Warning: main() [function.include]: Failed opening '/home/content/s/c/t/sctfaery/html/includes/header.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 7 Warning: main(/home/content/s/c/t/sctfaery/html/includes/main_menu.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 8 Warning: main() [function.include]: Failed opening '/home/content/s/c/t/sctfaery/html/includes/main_menu.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 8 Warning: main(/home/content/s/c/t/sctfaery/html/includes/footer.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 9 Warning: main() [function.include]: Failed opening '/home/content/s/c/t/sctfaery/html/includes/footer.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 9 Warning: main(/home/content/s/c/t/sctfaery/html/includes/template.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 10 Warning: main() [function.include]: Failed opening '/home/content/s/c/t/sctfaery/html/includes/template.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 10 -- is that it? I am beyond frustrated, I have another bit that I am setting up and it works fine?? jason Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817381 Share on other sites More sharing options...
Maq Posted April 23, 2009 Share Posted April 23, 2009 Are you positive this is the path to your includes folder? /home/content/s/c/t/sctfaery/html/includes Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817385 Share on other sites More sharing options...
nankoweap Posted April 23, 2009 Share Posted April 23, 2009 Are you positive this is the path to your includes folder? /home/content/s/c/t/sctfaery/html/includes my guess is.... not in the least. muffin... go to the directory where these include files are located and type: pwd what's output? Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817393 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 I'm not positive about anything.. sadly.. I am totally muddled.. so this site is hosted as a folder of another site /fab/ so how do i write it so it goes to that folder? I managed to install an Apache server ? on my local machine but I am not sure exactly how to direct each site where to put the testing files so I can see them.. I know, by now you are thinking you are dealing with a less than intelligent amoeba!! sorry.. Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817401 Share on other sites More sharing options...
Maq Posted April 23, 2009 Share Posted April 23, 2009 muffin, please answer the question. All you have to do is successfully navigate to the includes directory with the path that came with the error. Try to find this EXACT path: /home/content/s/c/t/sctfaery/html/includes If you can't then you're calling the includes incorrectly... Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817413 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 Are you positive this is the path to your includes folder? /home/content/s/c/t/sctfaery/html/includes my guess is.... not in the least. muffin... go to the directory where these include files are located and type: pwd what's output? go to the directory in what? the browser? Please don't give up on me.. Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817429 Share on other sites More sharing options...
Maq Posted April 23, 2009 Share Posted April 23, 2009 go to the directory in what? the browser? Please don't give up on me.. Anything. FTP, SSH, whatever you're using to view the directories. Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817431 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 Are you positive this is the path to your includes folder? /home/content/s/c/t/sctfaery/html/includes my guess is.... not in the least. muffin... go to the directory where these include files are located and type: pwd what's output? so my files from the root are: /fab/ images includes scripts Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817434 Share on other sites More sharing options...
Maq Posted April 23, 2009 Share Posted April 23, 2009 That's not what I asked but w/e. What's the correct full path to the includes folder? Please post it. Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817437 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 /home/content/s/c/t/sctfaery/html/fab/includes I'm pretty sure.. I am using dreamweaver which is why I asked where to go to see the directory thing that one of you said to type in (pwd) Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817440 Share on other sites More sharing options...
Maq Posted April 23, 2009 Share Posted April 23, 2009 I am using dreamweaver which is why I asked where to go to see the directory thing that one of you said to type in (pwd) That's only if you have SSH access. So let's go over this.... The path you're trying to access is currently: /home/content/s/c/t/sctfaery/html/includes The correct path: /home/content/s/c/t/sctfaery/html/fab/includes The relative path you're calling from your PHP page: ../includes/header.php The page you're calling it from: html/fab/content1.php So presumably you would change your relative path call to this to fix your problem: ../fab/includes/header.php Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817447 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 ok..so I did that and then this is the message I'm now getting Warning: main(/home/content/s/c/t/sctfaery/html../fab/includes/header.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 7 Warning: main() [function.include]: Failed opening '/home/content/s/c/t/sctfaery/html../fab/includes/header.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 7 Warning: main(/home/content/s/c/t/sctfaery/html../fab/includes/main_menu.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 8 Warning: main() [function.include]: Failed opening '/home/content/s/c/t/sctfaery/html../fab/includes/main_menu.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 8 Warning: main(/home/content/s/c/t/sctfaery/html../fab/includes/footer.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 9 Warning: main() [function.include]: Failed opening '/home/content/s/c/t/sctfaery/html../fab/includes/footer.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 9 Warning: main(/home/content/s/c/t/sctfaery/html../fab/includes/template.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 10 Warning: main() [function.include]: Failed opening '/home/content/s/c/t/sctfaery/html../fab/includes/template.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 10 Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817466 Share on other sites More sharing options...
Maq Posted April 23, 2009 Share Posted April 23, 2009 I'm assuming you called it wrong, can you show me the code, please? Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817474 Share on other sites More sharing options...
themuffin Posted April 23, 2009 Author Share Posted April 23, 2009 Maq- page goal.php- <?php $site_title = "Feeling Absolutely Fabulous"; $page_title = "Welcome Page"; $main .= "<div style=\"text-align:left; margin:10px;\">Welcome to the Feeling Absolutely Fabulous website!<br />I hope that you enjoy your time here</div>"; include_once($_SERVER['DOCUMENT_ROOT'] . '../fab/header.php'); include_once($_SERVER['DOCUMENT_ROOT'] . '../fab/main_menu.php'); include_once($_SERVER['DOCUMENT_ROOT'] . '../fab/includes/footer.php'); include_once($_SERVER['DOCUMENT_ROOT'] . '../fab/includes/template.php'); ?> ------------------- page content1.php- <?php $site_title = "My Website"; $page_title = "Sample Template Content Page 1"; $main .= "<div style=\"text-align:left; margin:10px;\">Welcome to the Feeling Absolutely Fabulous website!<br />I hope that you enjoy your time here</div>"; require('../fab/header.php'); require('../fab/includes/main_menu.php'); require('../fab/includes/footer.php'); require('../fab/includes/template.php'); ?> error message for content1.php Warning: main(../fab/header.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/c/t/sctfaery/html/fab/content1.php on line 7 Warning: main(../fab/header.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/c/t/sctfaery/html/fab/content1.php on line 7 Fatal error: main() [function.require]: Failed opening required '../fab/header.php' (include_path='.:/usr/local/lib/php') in /home/content/s/c/t/sctfaery/html/fab/content1.php on line 7 my humble apologies.. Quote Link to comment https://forums.phpfreaks.com/topic/155354-solved-i-am-new-what-am-i-doing-wrong/#findComment-817483 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.