天空小小岛技术网站

标题: Linux 下安装 PEAR [打印本页]

作者: phper    时间: 2015-10-17 22:25
标题: Linux 下安装 PEAR
什么是pear
pear是PHP扩展与应用库(the PHP Extension and Application Repository)的缩写。它是一个PHP扩展及应用的一个代码仓库,简单地说,pear就是PHP的cpan。
文档
http://pear.php.net/manual/zh/about-pear.php

1.下载
#curl -o go-pear.php http://pear.php.net/go-pear.phar
2.安装
#php go-pear.php
3.第一次安装时出现如下提示信息
  1. # php go-pear.php

  2. Below is a suggested file layout for your new PEAR installation.  To
  3. change individual locations, type the number in front of the
  4. directory.  Type 'all' to change all of them or simply press Enter to
  5. accept these locations.

  6. 1. Installation base ($prefix)                   : /root/pear
  7. 2. Temporary directory for processing            : /tmp/pear/install
  8. 3. Temporary directory for downloads             : /tmp/pear/install
  9. 4. Binaries directory                            : /root/pear/bin
  10. 5. PHP code directory ($php_dir)                 : /root/pear/share/pear
  11. 6. Documentation directory                       : /root/pear/docs
  12. 7. Data directory                                : /root/pear/data
  13. 8. User-modifiable configuration files directory : /root/pear/cfg
  14. 9. Public Web Files directory                    : /root/pear/www
  15. 10. System manual pages directory                 : /root/pear/man
  16. 11. Tests directory                               : /root/pear/tests
  17. 12. Name of configuration file                    : /root/.pearrc

  18. 1-12, 'all' or Enter to continue:
复制代码


这个时候如果觉得配置里的路径并没有出现你的  php 安装路径时,你就需要考虑你的 php.ini 禁用了一些方法导致无法读取到正确路径,可以先把禁用那个项给关了,等安装完后再打开。
关完之后,我再运行 go-pear.php 时就出现这样了
  1. 1. Installation base ($prefix)                   : /usr/local/env/php-5.4.28
  2. 2. Temporary directory for processing            : /tmp/pear/install
  3. 3. Temporary directory for downloads             : /tmp/pear/install
  4. 4. Binaries directory                            : /usr/local/env/php-5.4.28/bin
  5. 5. PHP code directory ($php_dir)                 : /usr/local/env/php-5.4.28/share/pear
  6. 6. Documentation directory                       : /usr/local/env/php-5.4.28/docs
  7. 7. Data directory                                : /usr/local/env/php-5.4.28/data
  8. 8. User-modifiable configuration files directory : /usr/local/env/php-5.4.28/cfg
  9. 9. Public Web Files directory                    : /usr/local/env/php-5.4.28/www
  10. 10. System manual pages directory                 : /usr/local/env/php-5.4.28/man
  11. 11. Tests directory                               : /usr/local/env/php-5.4.28/tests
  12. 12. Name of configuration file                    : /usr/local/env/php-5.4.28/etc/pear.conf
复制代码


然后继续回车,就安装完成了。

记得再把 disable_functions 那一项给打开即可。





欢迎光临 天空小小岛技术网站 (http://tkxxd.net/) Powered by Discuz! X3.1