1

I am pretty new at this so please bear with me. I have a raspberrypi that I am trying to set up as a server to remotely monitor with. I cannot seem to get php embedded in html to work. My simple code is:

<!DOCTYPE html>
    <head>
       <title>A test</title>
    </head>
<body>
<?php echo "hello world"; ?>
hello joe -----
</body>
</html>

When I access the server on the Pi from my laptop what I see in the browser is the 'hello joe-----' but not the 'hello world'. when I turn on the F12 debugger window it tells me html:1406 invalid tag start: ?> question marks do not start tags.

When I execute a similar file directly from the command line on the Pi in a terminal window [e.g. php5 test.php] it seems to run fine.

Could this be a php configuration issue? thx

ljb
  • 11
  • 2
  • Have you tried following the [official](https://www.raspberrypi.org/documentation/remote-access/web-server/apache.md) guide? – ABeltramo May 29 '17 at 08:03

1 Answers1

0

What official guide would that be?

In any event I solved the problem. I purged php5 from the Pi and reinstalled. That seems to have fixed it. Now it all works.

ljb
  • 11
  • 2