I am trying to get started with PHP by creating a HelloWorld application, but when I try to run it, the PHP part of the code is not working.
Where it should have a header saying Hello World!
It says Hello World'; ?> in regular text instead.
Any idea what I'm doing wrong?
Here is my code:
<html>
<head>
<meta charset="UTF-8">
<title>PHP Test</title>
</head>
<body>
<?php echo '<h1>Hello World</h1>'; ?>
</body>
</html>
I am running it using a local php server and it seems to be serving fine.
php -S localhost:8888
PHP 5.5.20 Development Server started at Tue Dec 8 14:12:26 2015
Listening on http://localhost:8888
Also, when I create a <?php phpinfo ?> saved as a php file, it works and gives all the data.
I already made sure to save it as a UTF-8-encoded file.