Report this

What is the reason for this report?

PHP include statements not executing on Ubuntu 12.04

Posted on March 3, 2014

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 <?php include ‘header.php’; ?>.

I can get a phpinfo file to run via <?php phpinfo(); ?> in an info.php file, but when I hit foo.php, the include statements seem to not be rendering on the server.

Any thoughts?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Looks like I lost some code/made some typos in the above post :P <br> <br>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. <br> <br>Header - http://pastebin.com/6wSJ5mse <br>Body - http://pastebin.com/z1PijAXJ <br>Footer - http://pastebin.com/PuUpRb35 <br> <br>Also, my folder hierarchy is setup like this: <br> <br>/www <br> -/html <br> -index.php <br> -/templates <br> -header.php <br> -footer.php <br>

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.