Running phar file from browser



I am trying to run a simple phar file from a web browser with apache.
I got this from the PHP manual

// creating the phar archive:
try {
    $phar = new Phar('myphar.phar');
    $phar['index.php'] = '<?php echo "Hello World"; ?>';
    $phar['index.phps'] = '<?php echo "Hello World"; ?>';
__HALT_COMPILER(); ?>');
} catch (Exception $e) {
    // handle error here

The manual says

display Hello World if one browses to /myphar.phar/index.php

However when I do this I get a Not Found

If I navigate to /myphar.phar I still get Not Found but the phar file is downloaded.

How do I set things up so that phar file will work as expected?

Here is how I am attempting to access


I solved this by adding the following to the httpd.conf

AddType application/x-httpd-php .php .phar