Run Any Script In A Phar

It is not possible to call directly a PHP script stored in a Phar archive: the only way to reach it, is using include(‘phar://$path’), where PHP understands the phar:// protocol.

And that makes it possible to call directly a PHP script from the shell: include it directly.

In terms of security, it is important to remember that a PHAR is an archive, and anything may be accessed or extracted.

../_images/run_any_phar_file.png