title: Getting 404 error when accessing php page in apache in a simple php application?
body: <p>I have created a simple php file <code>sample.php</code> under <code>/var/www/project/dummy/test/sample.php</code></p>
  
  <p>Here is the <code>httpd.conf</code></p>
  
  <pre><code> Listen 8080
      &lt;VirtualHost *:8080&gt;
              ServerName example.com
              DocumentRoot "/var/www/projects/dummy/test"
              &lt;Directory "/var/www/projects/dummy/test"&gt;
                  AllowOverride All
                  Allow from all
              &lt;/Directory&gt;
      &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>Here is the <code>sample.php</code> (just checking if memcache is enabled)</p>
  
  <pre><code>&lt;? php
  
  if(class_exists('Memcache')){
    echo "found";
  }
  
  ?&gt;
  </code></pre>
  
  <p>when I access <code>localhost:8080/sample.php</code> or <code>localhost:8080/test/sample.php</code>, I get <code>404 error</code>. I am unable to figure out what is going wrong.</p>
  
  <p>I am concerned why <code>localhost</code> if failing.</p>
  
  <p>To add to that, even <code>www.example.com/sample.php</code> is failing.</p>
  
  <p>Thanks for help</p>
  
  <p>P.S: I have mapped ip address in <code>/etc/hosts</code> as follows:</p>
  
  <p><code>127.0.0.1 example.com www.example.com localhost</code></p>
  
  <p>why is <code>localhost</code> failing?</p>