Jump to content

[SOLVED] I am new what am I doing wrong?


themuffin

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

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?

 

 

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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..

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.