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.
php -S localhost:80 /path/to/myphar.php
Result: blank page (in the phar front controller is index.php
doing some HTML output).
php -S localhost:80 -t /path/to/folder_with_index_and_phar
With loader script:
<?php
require 'phar://myphar.php'
Result in a blank page, again.
Is this even possible or I have to use Apache?
EDIT: after an year I need this again. Here is what's happening (from answers):
php -S localhost:80 -t /path/to/app.phar
php -S localhost:80 -t /path/to/app.phar
Results in an error: /path/to/app.phar is not a directory.
While:
php -S localhost:80 -t .
http://localost/app.phar/foo/bar
Works, but I don't need the app.phar "prefix"!
Using Apache and setting the directory index to app.phar works as expected.
myphar.php
. What happen if you excuteecho "<?php phpinfo();" > myphar.php
– Bedtime