質問

Debianおよびそれによると、PHP 5.3を使用しています php -m 「ファー」がロードされます。

しかし、実行します php pyrus.phar また php pyrus.phar config-show 出力はまったくありません。

何が問題なのでしょうか?

debian:~# php -v
PHP 5.3.5-1 with Suhosin-Patch (cli) (built: Feb 19 2011 01:57:59)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
    with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

php -i 私に与える:

[...]

Phar

Phar: PHP Archive support => enabled
Phar EXT version => 2.0.1
Phar API version => 1.1.1
SVN revision => $Revision: 305584 $
Phar-based phar archives => enabled
Tar-based phar archives => enabled
ZIP-based phar archives => enabled
gzip compression => enabled
bzip2 compression => enabled
OpenSSL support => enabled


Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
Directive => Local Value => Master Value
phar.cache_list => no value => no value
phar.readonly => On => On
phar.require_hash => On => On

[...]

私を混乱させるのは、libxml2がデフォルトでphp> 5.3.1で利用可能であると想定されているが、php -mはlibxmlのみをリストしていることです。 php -iは私に与えます:

libXML support => active
libXML Compiled Version => 2.7.8
libXML Loaded Version => 20708
libXML streams => enabled
役に立ちましたか?

解決

それを見つけた :)

DebianはSuhosin Patchを使用してPHPバージョンをインストールするようです。 PHP -Vの私自身の出力には、次のことが表示されます。

web01:/home/berry# php -v
PHP 5.3.5-1 with Suhosin-Patch (cli) (built: Feb 19 2011 01:57:59) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

現在、スホシンはこの問題を引き起こしているようです。PHARファイルの実行を許可していません。 /var/log/user.logを見ると、次のようにエントリが表示されます。

web01:/home/berry# tail /var/log/user.log | grep pyrus
Mar 23 11:27:50 web01 suhosin[17463]: ALERT - Include filename ('phar:///home/berry/pyrus.phar/PEAR2_Pyrus-2.0.0a2/php/PEAR2/Pyrus/ScriptFrontend/Commands.php') is an URL that is not allowed (attacker 'REMOTE_ADDR not set', file '/home/berry/pyrus.phar', line 40)

これをCLIでのみ実行しているため、以下のラインを/etc/php5/cli/conf.d/phar.iniに追加する必要があります。この問題を修正する必要があります。

suhosin.executor.include.whitelist="phar"

幸運を :)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top