$ ./pear version PEAR Version: 1.9.4 PHP Version: 5.4.26 Zend Engine Version: 2.4.0验证php的include path pear的扩展安装在php的 include path下。
$ ./pear config-get php_dir /home/gang/php/lib/php
$ ./pear Commands: build Build an Extension From C Source bundle Unpacks a Pecl Package channel-add Add a Channel channel-alias Specify an alias to a channel name channel-delete Remove a Channel From the List ...
$ ./pear help install
$ ./pear install LOG运行成功后在 php/lib目录下会生成Log.php和Log目录,以及doc目录 在doc/Log下面有使用例子和说明。
./pear upgrade LOG
<?php require_once 'Log.php'; $logger = Log::singleton('error_log', PEAR_LOG_TYPE_SYSTEM, 'ident'); for ($i = 0; $i < 10; $i++) { $logger->log("Log entry $i"); }
$ ./pear remote-list