I have installed Apache2
and PHP 7
with(sudo apt-get install php7.0 php7.0-mcrypt)
on my machine. When I hit php -v
in terminal, it return:
PHP 7.0.4-7ubuntu2.1 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
So then I created one PHP
file at var/www/html/e.php
with the below content:
<!DOCTYPE html>
<html>
<body>
<h1>My first PHP page</h1>
<?php
echo "Hello World!";
?>
</body>
</html>
When I open the browser (http://localhost/e.php), it does not show the php variable, just works the html tag. What am I missing? The Ubuntu "It Works" page of Apache works.
Thanks in advance.