title: index.php is not loading by default in apache2
body: <p>I just installed Ubuntu 17.04 and set up my LAMP server w/ PHP7 and the PHP modules enabled for Apache2.</p>
  
  <p>When I go to <code>http://localhost/</code> it defaults to the <code>index.html</code> that is present in <code>/var/www/html</code> and not the <code>index.php</code> that is there. When I go to <code>http://localhost/index.php</code> the php file loads just fine and the php script executes.</p>
  
  <p>In looking at other posts ( <a href="https://stackoverflow.com/questions/2384423/index-php-not-loading-by-default">index.php not loading by default</a> ) I saw that the preferred solution is to edit the <code>/etc/apache2/mods-enabled/dir.conf</code> file to move the <code>index.php</code> before the <code>index.html</code> in the DirectoryIndex entry.</p>
  
  <pre><code>&lt;IfModule mod_dir.c&gt;
      DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>So I did this and saved the file as sudo, restarted the apache service as well as tried restarting the computer and it still serves the index.html first. Any idea? Should I use the .htaccess file solution instead? Thanks!</p>