Search code examples
phpwampserver

Strange behaviour of php using wamp


I have been using wamp server do build small websites with php for a long time.. but this morning something strange just happend :

here is my home.html file :

<html>
 <head>
  <title>Test PHP</title>
 </head>
 <body>
 <?php echo '<p>Hello world</p>'; ?>
 </body>
</html>

and here is what I get when I display the page :

Hello world
'; ?>

And when I display the source code, here is what I get :

<html>
 <head>
  <title>Test PHP</title>
 </head>
 <body>
 <?php echo '<p>Hello world</p>'; ?>
 </body>
</html>

It seems to be a very stupid problem where the php code is not interpreted by the server.. Any suggestion ?


Solution

  • You saved the filename as .html

    Use .php instead of .html it will interrupt.