PHP include statements not executing on Ubuntu 12.04

March 3, 2014 2.3k views
I am configuring PHP for the first time on my Ubuntu 12.04 distro and am not able to render my foo.php file to render any of the files attached with an include statement. For example, I have header.php and footer.php referenced in foo.php with . I can get a phpinfo file to run via in an info.php file, but when I hit foo.php, the include statements seem to not be rendering on the server. Any thoughts?
5 Answers
Looks like I lost some code/made some typos in the above post :P

Short story is that I am suspicious of include 'header.php' and include 'footer.php' statements not rendering on new LAMP distro. phpinfo() runs fine.
Can you pastebin your files?
Sure thing.

Header -
Body -
Footer -

Also, my folder hierarchy is setup like this:

:( And since I'm not able to edit my posts, here's a better representation of the folder hierarchy:

You're trying to include files from
which doesn't exist. You have to either use relative paths (./templates/header.php) or absolute paths (/var/www/templates/header.php).
Have another answer? Share your knowledge.