PHP include statements not executing on Ubuntu 12.04

Posted March 3, 2014 5.6k 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?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
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).