[ticket/12620] Fix download/file.php and app.php outside of the root_path

PHPBB3-12620
[ticket/12620] Uses a cache directory per environment

PHPBB3-12620