Solved

Simple PHP Question

Posted on 2004-10-04
4
186 Views
Last Modified: 2013-12-25
Here is what I have:

an include directory with the following:
style.php
header.php
footer.php

inside index.php source is the following:

<?php include("style.php"); ?>

<?php include("header.php"); ?>

<?php include("footer.php"); ?>

Only one that works is header.php, style.php and footer.php are uploaded.  Error I get is:

Warning: main(footer.php): failed to open stream: No such file or directory in /xxx/about_more.php on line 81

Warning: main(footer.php): failed to open stream: No such file or directory in /xxx/about_more.php on line 81

Warning: main(): Failed opening 'footer.php' for inclusion (include_path='.:/usr/local/lib/php') in /xxx/about_more.php on line 81
0
Comment
Question by:precision
  • 2
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
nicholassolutions earned 350 total points
ID: 12219828
Try putting the FULL path in your includes, e.g.:

<?php include('/home/username/includes/footer.php'); ?>

It looks like PHP may not be looking in the directory where you have your stuff.
0
 

Author Comment

by:precision
ID: 12219861
I will try that but 1 out of the 3 work and they are all in the same locations with the same calls as above.
0
 

Author Comment

by:precision
ID: 12219884
Bingo!  Don't ask me why, 1 worked and the 2 others did not as I had originally.  When I did what you recommended they all work with the full path.  Thanks!
0
 
LVL 15

Expert Comment

by:nicholassolutions
ID: 12220296
glad to help ;)
That problem got me a bunch of times when I was starting out with PHP...and a couple times since ;)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now