linux系统

linux下安装php的扩展包pear[更新]

PEAR是PHP的官方开源类库, PHP Extension and Application Repository的缩写。Pear在英文中是梨子的意思。PEAR将PHP程序开发过程中常用的功能编写成类库,涵盖了页面呈面、数据库访问、文件操作、数据结构、缓存操作、网络协议等许多方面,用户可以很方便地使用。

今天在我的测试机上还使用之前介绍的安装方法:

lynx –source http://pear.php.net/go-pear |/usr/local/php/bin/php

结果发现不能用了,出现提示如下

Sorry!  Your PHP version is too new (5.2.14) for this go-pear.
Instead use http://pear.php.net/go-pear.phar for a more stable and current
version of go-pear, more suited to your PHP version.

Thank you for your coopertion and sorry for the inconvenience!

于是来到官方,发现安装方式有所改变。这次需要两步来完成,如下

Below is a suggested file layout for your new PEAR installation.  To

change individual locations, type the number in front of the

directory.  Type ‘all’ to change all of them or simply press Enter to

accept these locations.

1. Installation base ($prefix)                   : /usr/local/php

2. Temporary directory for processing            : /tmp/pear/install

3. Temporary directory for downloads             : /tmp/pear/install

4. Binaries directory                            : /usr/local/php/bin

5. PHP code directory ($php_dir)                 : /usr/local/php/lib/php

6. Documentation directory                       : /usr/local/php/docs

7. Data directory                                : /usr/local/php/data

8. User-modifiable configuration files directory : /usr/local/php/cfg

9. Public Web Files directory                    : /usr/local/php/www

10. Tests directory                               : /usr/local/php/tests

11. Name of configuration file                    : /usr/local/php/etc/pear.conf

1-11, ‘all’ or Enter to continue:

这个根据个人环境进行修改。

相对pear的简单使用可以参考《linux下安装php的扩展包pear》。具体使用还请去官网查看。

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *