Localhost Drupal Install on Linux shows file and not site I am trying to set up a local Drupal install on my Linux 16.04 laptop install for learning/exploring Drupal. 

I have made it through this install guide
, completing all steps, but when launching my http://my_example_drupal_site.localhost/web/
I am getting the below output.

Any idea why this is?
    

/**
 * @file
 * The PHP page that serves all page requests on a Drupal installation.
 *
 * All Drupal code is released under the GNU General Public License.
 * See COPYRIGHT.txt and LICENSE.txt files in the "core" directory.
 */

use Drupal\Core\DrupalKernel;
use Symfony\Component\HttpFoundation\Request;

$autoloader = require_once 'autoload.php';

$kernel = new DrupalKernel('prod', $autoloader);

$request = Request::createFromGlobals();
$response = $kernel-&gt;handle($request);
$response-&gt;send();

$kernel-&gt;terminate($request, $response);




Solved

Followed this guide as suggested and got my install working.

Ran into two issues along the way. Turns out when setting up my Linux Box long ago, I had an entry in /etc/hosts/ file that had a name for 'localhost'.

When pointing my browser at localhost, the default Apache "It Works!" page did not work. However when pointing to the name I had in /etc/hosts/ it did work.
But php file would not load and only showed "Index Of /" in the browser.

After more searching, I came to find I needed to load the mod in apache.

Trying:

a2query -m php7.0
No module matches php7.0


did not work, even though it was already installed which I discovered after trying to reinstall it

php7.0 is already the newest version (7.0.25-0ubuntu0.16.04.1)

Finally stumbled upon this answer in AskUbuntu and low and behold this worked for me, allowing me to enable the mod in apache

sudo apt-get purge php*

sudo apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi  php7.0 libapache2-mod-php7.0

I don't know how or why, but it worked for me.
Just to get the question answered:

You missed the step about setting up Apache and PHP in the installation guide you read. In particular, you have to follow the How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04 guide from DigitalOcean - linked to in the installation guide.