|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-01-22 04:41 UTC] panman at traileyes dot com
-Summary: Cannot Access mount()'ed Items From
Web
+Summary: Cannot Access Phar::mount()'ed
Items From Web
-Operating System:
+Operating System: Win 7 32 bit
[2011-01-22 04:41 UTC] panman at traileyes dot com
[2011-01-22 08:52 UTC] panman at traileyes dot com
[2011-01-24 22:35 UTC] panman at traileyes dot com
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
Description: ------------ Using the mount() method brings in files/folders so that PHP scripts can use them internally. However, those files are not accessible through the Web server as the built-in files are. The directory structure should be as follows for the test below: make.php = The test script below internal.html = <p>From the inside</p> external.html = <p>From the outside</p> include.php = <?php include 'external.html'; ?> test.phar = Will be built from the test script Test script: --------------- <?php try { $p = new Phar('test.phar'); $p->addFile('internal.html'); $p->addFile('include.php'); $p->setStub('<?php Phar::webPhar("test.phar", "internal.html"); Phar::mount(__DIR__ . "/external.html", "external.html"); __HALT_COMPILER();'); echo 'Done making test.phar'; } catch (Exception $e) { echo 'Exception caught: ' . $e->getMessage(); } ?> Expected result: ---------------- Visiting: make.php Done making test.phar Visiting: test.phar/internal.html From the inside Visiting: test.phar/external.html From the outside Visiting: test.phar/include.php From the outside Actual result: -------------- Visiting: make.php Done making test.phar Visiting: test.phar/internal.html From the inside Visiting: test.phar/external.html 404 - File /external.html Not Found Visiting: test.phar/include.php From the outside