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