Question:

Why is it that when I put a php include in my index.php it doesn't show up?

by  |  earlier

0 LIKES UnLike

It shows up when I got to mysite.net/header.php.

 Tags:

   Report

2 ANSWERS


  1. Without actually seeing your include statement it's kinda hard to say. But  you probably just have the path to your header.php file wrong. I think it needs to be a full absolute path. Depending on your file structure, something resembling...

    include("C:/apache/fullSourcePath/head...

    The "C:/" is if you're on a Windows server. Remember that path is not relative to your domain name. So DON'T do something like...

    include("mysite.net/header.php");


  2. In Apache, is your default document root directive set to index.php? If that isn't listed as one of your default files when someone goes to your site, Apache won't serve it up unless you manually type in the name of the file.  

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.