|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-07-12 23:03 UTC] myselfasunder at gmail dot com
Description:
------------
I'm using an Apache alias to map "/" to my Phar, and the webPhar() call acts as if it was run from the CLI.
Test script:
---------------
My setStub() call looks like:
$phar->setStub('<?php
Phar::interceptFileFuncs();
Phar::webPhar("TestPhar.phar", "TestPhar/index.php");
echo "I am intended to be executed from a web browser: " . php_sapi_name() . "\n";
exit -1;
__HALT_COMPILER();
');
Apache's alias:
Alias / C:/Development/webdir/vhosts/phartest/TestPhar.phar
Expected result:
----------------
"I am index."
Actual result:
--------------
I am intended to be executed from a web browser: apache2handler
(*notice that PHP still recognizes that we're running under Apache. Why doesn't webPhar()?)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 03:00:01 2025 UTC |
My current system is PHP 5.2.12 under Windows 7. Taking the PECL package from 5.2.6 (because that's the most recent available for 5.2.12), and using the Phar module, I've executed the following: var_dump(preg_grep('/web/i', get_class_methods('Phar'))); and got the following matching methods: array(2) { [54]=> string(7) "webPhar" [125]=> string(7) "webPhar" } Therefore, not only is it available under 5.2.12, it must be available under 5.2.6 as well. Do you have an actual response to the bug report? DustinI'm also seeing this bug whilst running Apache. However I'm using: $phar->setDefaultStub('cli/console.php', 'web/web.php'); I noticed in the default stub of the phar is the line: if (@(isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD']) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'POST')) If I echo those from console.php I see they are set and that line should pass. Also makes me point to Phar::webPhar Tested on PHP 5.4.11, 5.3.21, 5.2.17 The phar was recreated under each version also.