title: How to run a webphar PHP file from built-in PHP 5.4 webserver?
body: <p>As per title, I created a very simple test phar. I'd like to test it with the built-in webserver(PHP 5.4) but it seems impossible.</p>
  
  <pre><code>php -S localhost:80 /path/to/myphar.php
  </code></pre>
  
  <p><s>Result: blank page (in the phar front controller is <code>index.php</code> doing some HTML output).</p>
  
  <pre><code>php -S localhost:80 -t /path/to/folder_with_index_and_phar
  </code></pre>
  
  <p>With loader script:</p>
  
  <pre><code>&lt;?php
  
  require 'phar://myphar.php'
  </code></pre>
  
  <p>Result in a blank page, again.</s></p>
  
  <p>Is this even possible or I have to use Apache?</p>
  
  <p><strong>EDIT</strong>: after an year I need this again. Here is what's happening (from answers):</p>
  
  <pre><code>php -S localhost:80 -t /path/to/app.phar
  php -S localhost:80 -t /path/to/app.phar
  </code></pre>
  
  <p>Results in an error: /path/to/app.phar is not a directory.</p>
  
  <p>While:</p>
  
  <pre><code>php -S localhost:80 -t .
  http://localost/app.phar/foo/bar
  </code></pre>
  
  <p>Works, but <strong>I don't need the app.phar</strong> "prefix"!</p>
  
  <p>Using Apache and setting the directory index to app.phar works as expected.</p>