I created the phar of a Symfony2 web application, but I am having problems with cache folders.
I found out that I can mount an external file / folder in phar. This will fix my problem, but I cannot get an example on a PHP site.
I have a phar that contains index.php:
<?php
$configuration = simplexml_load_string(file_get_contents(
Phar::running(false) . '/config.xml'));
?>
Then I turn on .phar with the following code:
<?php
Phar::mount('phar://config.xml', '/var/www/$projectname/config.xml');
include 'phar-archive.phar';
?>
All files exist, but I get the following error:
PHP Fatal error: "PharException" exception exception with the message "config.xml is not a file archive, cannot be mounted" in / var / www / $ projectname / index.php: 3
I have already tried relative / absolute paths, changing permissions, but can't make it work. Also, a working example of how I can set the folder in phar will be great!