Solved

Simple PHP Question

Posted on 2004-10-04
4
191 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Script Host failed (Access is denied.) error 6 149
Disk Ram Peak 1 42
How does Redux fit into React? 3 80
Powershell  and PSExec = Password failure 5 22
This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
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…

809 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