title: .php files downloading instead of executing
body: <p>I am brand new to Apache and PHP. </p>
  
  <p>I created a helloworld.php file and when I run it, the file downloads and the command is never executed.</p>
  
  <p>I use Ubuntu 16.04 with Apache 2 and PHP 7.1 .</p>
  
  <p>I tried completely reinstalling everything and also editing the apache2.conf file with this :</p>
  
  <pre><code>&lt;FilesMatch \.php$&gt;
  SetHandler application/x-httpd-php
  &lt;/FilesMatch&gt;
  </code></pre>
  
  <p>But this did not work.</p>
  
  <p>I tried installing LAMP from : <a href="https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04</a></p>
  
  <p>But during the last step, I created an info.php file with these lines of code :</p>
  
  <pre><code>&lt;?php
  phpinfo();
  ?&gt;
  </code></pre>
  
  <p>And the above lines were displayed as it is.</p>
  
  <p>I tried finding the solution, but most of them mention a httpd.conf file, which I am not able to find anywhere.</p>
  
  <p>I know this question has been asked multiple times before, but I didn't find a satisfactory solution.</p>