0

I am using MAMP free version on Windows10 using default ports (80, 80, 3306). My working directory "dynamicwebsites.com" is inside mamp/htdocs sub-directory. I have an "includes" sub-directory with "header.php" and "footer.php" files. I am calling header.php and footer.php in my index.php (which is in root folder i.e. inside "dynamicwebsites.com)

I have just three statements in index.php file

<?php echo"index.php from dynamicwebsite.com";
<?php include('includes/header.php'); ?>
<?php include('includes/footer.php'); ?> 

The above code only displays the message. However, if I place the echo function between the two include functions then nothing is displayed. I have tried moving "header.php" and "footer.php" to root folder and only use <?php include('header.php');?> statement, but the result was the same. I get a message displayed with echo function this means PHP is working. I never had any problem using MAMP when I installed WordPress locally. However, I am facing problems running php scripts all alone.

I do not understand why echo function does not work if I put it in between include functions.

Could anyone help ? Thanks

  • 1
    What's the contents of your `header.php` and `footer.php` files? Have you checked your Apache error log? Turn on error reporting. `error_reporting(E_ALL)` at the top of your `index.php` file. – fubar Sep 12 '17 at 05:03
  • Possible duplicate of [How do I get PHP errors to display?](https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display) – Neodan Sep 12 '17 at 05:16

0 Answers0