在linux上安装pear
在搭建centreon的过程中,需要pear模块支持。
什么是pear
pear是PHP扩展与应用库(the PHP Extension and Application Repository)的缩写。它是一个PHP扩展及应用的一个代码仓库,简单地说,pear就是PHP的cpan。
在官网上有说明详细的安装信息,这里作简单说明。
http://pear.php.net/manual/en/about-pear.php
我的PHP目录为/usr/local/php5
在Linux下安装PHP的PEAR:
1)下载
#curl -o go-pear.php http://pear.php.net/go-pear
如果提示:
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 http://pear.php.net/go-pear.phar for a more stable and current
version of go-pear, more suited to your PHP version.
那么要从http://pear.php.net/go-pear.phar获取。
#curl -o go-pear.php http://pear.php.net/go-pear.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 直接执行PHP 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:
http://pear.php.net/faq.php
http://pear.php.net/manual/
安装完毕
下面通过pear来安装PHP_PEAR_DB库
http://pear.php.net/package/DB/download
先下载了,然后安装:
# /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

原文地址 http://blog.chinaunix.net/uid-25266990-id-3393387.html
在linux上安装pear的更多相关文章
- 在Windows和Linux上安装paramiko模块以及easy_install的安装方法
一.paramiko模块有什么用? paramiko是用python语言写的一个模块,遵循SSH2协议,支持以加密和认证的方式,进行远程服务器的连接.由于使用的是python这样的能够跨平台运行的语言 ...
- 在Linux上安装Oracle RAC 12 c(12.1) 虚拟机,一步一步向导
Oracle RAC 12 c(12.1)在Linux上安装虚拟机,一步一步向导 今天我们将看到如何安装 12 c版本1 RAC(真正的应用程序集群)数据库2 Linux 64位的虚拟机 使用VMWa ...
- WINDOWS和Linux上安装php7 alpha 并安装 yaf
WINDOWS和Linux上安装php7 alpha 并安装 yaf PHP技术 widuu 2个月前 (06-15) 126浏览 0评论 windows 1.windows上安装 php7 ...
- 在Windows和Linux上安装paramiko模块
一.paramiko模块有什么用? paramiko是用python语言写的一个模块,遵循SSH2协议,支持以加密和认证的方式,进行远程服务器的连接.由于使用的是python这样的能够跨平台运行的语言 ...
- Linux上安装使用boost入门指导
Data Mining Linux上安装使用boost入门指导 获得boost boost分布 只需要头文件的库 使用boost建立一个简单的程序 准备使用boost二进制文件库 把你的程序链接到bo ...
- 如何在Linux上安装Storm
Storm是开源的分布式实时计算系统,能够让数据流处理变得简单.可靠,也因此在大数据领域有广泛的实际 应用.下面介绍一下如何在Linux系统上安装Storm.根据Storm官网介绍,安装Storm软件 ...
- linux上安装Drupal
linux上安装Drupal 前言:国内用drupal的并不太多,网上资料也很少.要注意的是drupal尽量别使用apt来安装,特别是ubuntu平台的drupal做出了一定的更改,会妨碍后期的学习和 ...
- 在Linux上安装Hadoop
先决条件: Hadoop是用JAVA写的,所以首先要安装Java.在Ubuntu上安装JDK见:http://blog.csdn.net/microfhu/article/details/766739 ...
- linux上安装配置samba服务器
linux上安装配置samba服务器 在linux上安装配置samba服务器 在这给大家介绍一个不错的家伙,samba服务.如果您正在犯愁,如何在Windows和Linux之间实现资源共享,就请看看这 ...
随机推荐
- Latex 出现编辑公式,出现错误 !pdfTex error: Font rntxmi7 at 438 not found
http://docs.miktex.org/manual/advanced.html http://www.cl-projects.de/projects/misc/miktex-fonts.pht ...
- Tiles Framework
tiles framework 详解tiles framework 详解 就是一个页面模版引擎.可以渲染页面,属于视图层. 下面给你拷贝一份详细的tiles介绍,你可以初步了解一下. Tiles框架特 ...
- dijkstra算法 模板
算法理解见: https://www.bilibili.com/video/av18586085/?p=83 模板: #define INF 1000000000 int N; int dist[10 ...
- [Vue CLI 3] 配置解析之 indexPath
在 vue.config.js 配置中有一个 indexPath 的配置,我们先看看它有什么用? 用来指定 index.html 最终生成的路径(相对于 outputDir) 先看看它的默认值:在文件 ...
- 如何合并两个git commit
把你的修改stage之后运行: git rebase -i HEAD~2 然后把第二行的pick改成squash就ok啦 note: 同理,如果要合并多个commit,把后面的2改成你想要合并的com ...
- JS黑科技
1.论如何优雅的取随机字符串 Math.random().toString(16).substring(2) // 13位 Math.random().toString(36).substring(2 ...
- Elasticsearch 启动需要密码?
vagrant@homestead:~$ systemctl disable elasticsearch.service Synchronizing state of elasticsearch.se ...
- docker入门 基础命令 docker安装
docker入门 在学一门新知识的时候,超哥喜欢提问,why?what?how? wiki资料 什么是docker Docker 最初是 dotCloud 公司创始人 Solomon Hykes ...
- 判断字符s是否为正整数和正小数
下面一段代码是判断是否为正整数和正小数的:
- 【JZOJ4889】【NOIP2016提高A组集训第14场11.12】最长公共回文子序列
题目描述 YJC最近在学习字符串的有关知识.今天,他遇到了这么一个概念:最长公共回文子序列.一个序列S,如果S是回文的且分别是两个或多个已知序列的子序列,且是所有符合此条件序列中最长的,则 S 称为已 ...