PHP Includes not running locally?

Hi there,

I’ve been setting up my sites via WAMP and have come across a problem with PHP includes files not appearing on my webpages. I’ve used the correct syntax I believe - “<?php include(“includes/page.php”); ?>” to include my files but they are simply not appearing. I haven’t had chance to check them on a live server as yet since I am in the middle of a host-transfer.

WAMP is running with Apache, PHP 5.4 and I have disabled IIS which was previously interrupting port 80.

I have also tried using “requires” instead of “include” but still no joy - I have read that this doesn’t make any difference anyway other than how important PHP regards the include to be.

I’m getting no errors and when I manually navigate to the includes file and view the source file it is displaying the HTML correctly. Is there anything I need to be putting into my files other than the raw HTML e.g. “<div id=“view-website”>View Website</div>”?

Apologies for being a bit new to PHP, I’ve long-been a static HTML/CSS etc guy and this is my first taste of PHP.

Any thoughts?

Cheers!

make sure that you have open the display_errors and set the error_reporting to E_ALL, and the path to the file is right.

That was all correct :slight_smile:
Seems it was a schoolboy error, I’d hit S12 in Dreamweaver expecting to see my webpage in all its glory but of course it hadn’t gone through a testing server to execute the PHP. I tapped in localhost/[projectname] and it worked flawlessly!

Any ideas on how to set up Dreamweaver so I can just hit S12 and it executes the code using WAMP?