Edit report at http://bugs.php.net/bug.php?id=53801&edit=1
ID: 53801
User updated by: panman at traileyes dot com
Reported by: panman at traileyes dot com
-Summary: Cannot Access mount()'ed Items From Web
+Summary: Cannot Access Phar::mount()'ed Items From Web
Status: Open
Type: Bug
Package: PHAR related
-Operating System:
+Operating System: Win 7 32 bit
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
Added the OS I'm on.
Previous Comments:
------------------------------------------------------------------------
[2011-01-21 05:24:07] panman at traileyes dot com
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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53801&edit=1