linux上安装php的pear-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 6315185
  • 博文数量: 162
  • 博客积分: 3600
  • 博客等级: 中校
  • 技术积分: 10366
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-19 11:23
个人简介

专注系统运维、网络架构,研究技术凯发app官方网站的解决方案,记录我的思想轨迹、工作学习、生活和关注的领域

文章分类
文章存档

2014年(2)

2013年(16)

2012年(27)

2011年(117)

相关博文
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·

分类: 系统运维

2012-11-01 11:29:17

在搭建centreon的过程中,需要pear模块支持。

什么是pear

pear是php扩展与应用库(the php extension and application repository)的缩写。它是一个php扩展及应用的一个代码仓库,简单地说,pear就是php的cpan。

在凯发k8官网下载客户端中心官网上有说明详细的安装信息,这里作简单说明。

我的php目录为/usr/local/php5

在linux下安装php的pear:
1)下载
#curl -o go-pear.php 

如果提示:

php warning:  php startup: invalid library (maybe not a php library) ‘json.so’  in unknown on line 0
sorry!  your php version is too new (5.2.9) for this go-pear.
instead use .phar for a more stable and current
version of go-pear, more suited to your php version.

那么要从.phar获取。

#curl -o go-pear.php .phar

% total    % received % xferd  average speed   time    time     time  current
dload  upload   total   spent    left  speed
100 3594k  100 3594k    0     0   186k      0  0:00:19  0:00:19 –:–:–  196k

会在当前目录下载go-pear.php 页面。
2)运行go-pear.php
# /usr/local/php5/bin/php go-pear.php

3)这里按回车继续安装,ctrl c放弃安装。

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/php5
2. temporary directory for processing            : /tmp/pear/install
3. temporary directory for downloads             : /tmp/pear/install
4. binaries directory                            : /usr/local/php5/bin
5. php code directory ($php_dir)                 : /usr/local/php5/lib/php
6. documentation directory                       : /usr/local/php5/docs
7. data directory                                : /usr/local/php5/data
8. user-modifiable configuration files directory : /usr/local/php5/cfg
9. public web files directory                    : /usr/local/php5/www
10. tests directory                               : /usr/local/php5/tests
11. name of configuration file                    : /usr/local/php5/etc/pear.conf

1-11, ‘all’ or enter to continue:
beginning install…
configuration written to /usr/local/php5/etc/pear.conf…
initialized registry…
preparing to install…
installing phar://go-pear.phar/pear/go-pear-tarballs/archive_tar-1.3.7.tar…
installing phar://go-pear.phar/pear/go-pear-tarballs/console_getopt-1.3.0.tar…
installing phar://go-pear.phar/pear/go-pear-tarballs/pear-1.9.4.tar…
installing phar://go-pear.phar/pear/go-pear-tarballs/structures_graph-1.0.4.tar…
installing phar://go-pear.phar/pear/go-pear-tarballs/xml_util-1.2.1.tar…
install ok: channel://pear.php.net/archive_tar-1.3.7
install ok: channel://pear.php.net/console_getopt-1.3.0
install ok: channel://pear.php.net/structures_graph-1.0.4
install ok: channel://pear.php.net/xml_util-1.2.1
install ok: channel://pear.php.net/pear-1.9.4
pear: optional feature webinstaller available (pear’s web-based installer)
pear: optional feature gtkinstaller available (pear’s php-gtk-based installer)
pear: optional feature gtk2installer available (pear’s php-gtk2-based installer)
pear: to install optional features use “pear install pear/pear#featurename”

** warning! old version found at /usr/local/php5/bin, please remove it or be sure to use the new /usr/local/php5/bin/pear command

the ‘pear’ command is now at your service at /usr/local/php5/bin/pear

** the ‘pear’ command is not currently in your path, so you need to
** use ‘/usr/local/php5/bin/pear’ until you have added
** ‘/usr/local/php5/bin’ to your path environment variable.

run it without parameters to see the available actions, try ‘pear list’
to see what packages are installed, or ‘pear help’ for help.

for more information about pear, see:

安装完毕

下面通过pear来安装php_pear_db库


先下载了,然后安装:

# /usr/local/php5/bin/pear install db-1.7.14.tgz
package "pear.php.net/db" dependency "pear.php.net/pear" has no releases
install ok: channel://pear.php.net/db-1.7.14

# find  / -name "db.php"
/usr/local/php5/lib/php/db.php

阅读(42356) | 评论(0) | 转发(2) |
给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图