`
zhangjijun
  • 浏览: 33576 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Linux上安装php的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
# /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

 

分享到:
评论

相关推荐

    libsodium-php:libsodiumPHP扩展

    libsodium-php 一个简单的低级PHP扩展。 需要libsodium> = 1.0.9和PHP 7. {0,1,2,3,4} .x或PHP 8.0.x 完整的文档在这里: ,这是使用... 在某些Linux发行版(例如Debian)上,您可能必须先安装PECL( php-pear ),

    php-5.3.8源码安装包

    2. 在Linux下安装,按照如下步骤: tar jxvf php-5.3.8.tar.bz2 cd php-5.3.8 ./configure --prefix=$HOME/local/...

    php-7.2.26.tar.xz

    会进入编辑模式,如果你不会用 Linux 下的 Vim 软件,请自信使用搜索引擎学习,编辑内容如下: 错误日志: error_log = /usr/local/php/var/log/php-fpm.log PID 文件配置 pid = /usr/local/...

    PHP解压tar.gz格式文件的方法

    本文实例讲述了PHP解压tar.gz格式文件的方法。...linux下 /usr/local/php/bin/pear install Archive_Tar wamp默认没有安装pear, go-pear.php 适合旧版本的 , php5.3 需要 下载 go-pear.phar 将下载

    php格式化工具Beautify PHP小小BUG

    Beautify PHP,很好用的php格式化工具 ...丢到linux下还可以快速批量处理@.@ 好了,以下是本帖主题: Beautify PHP格式化符号时,遗漏了^=和&=判断, 在beautify_php.class.inc第426行,增加这两个符号 // add space 

    php:php Cookbook的开发资料库

    它安装并配置PHP和PEAR软件包管理系统。 还包括用于管理PEAR(和PECL)程序包,PECL通道和PHP-FPM池的资源。 维护者 这本食谱由Sous Chefs负责维护。 Sous Chefs是由厨师食谱维护者组成的社区,他们共同维护重要的...

    xdebug:Xdebug —用于PHP的步骤调试器和调试工具

    Xdebug的 Xdebug是用于PHP的调试工具。 它提供了逐步调试功能以及... 除非在Linux上使用软件包管理器安装了Xdebug,否则还需要将以下行添加到php.ini文件中,或在conf.d目录中创建一个新的Xdebug特定ini文件xdebug.i

    Search-API-Amazon-CloudSearch:适用于 Amazon Cloudsearch 的 Drupal 7 Search API 模块

    通过 PEAR(推荐) 从命令行,您可以使用 PEAR 安装 SDK,如下所示(假设为 LINUX): pear 频道-发现 pear.amazonwebservices.com pear 安装 aws/sdk 通过 GitHub 将源代码下拉到sites/all/libraries/awssdk 下的...

    sublime3-drupal:用于 Drupal 开发的 Sublime3 配置

    sublime3-drupal 配置(用户设置)和推荐的用于 Drupal 开发的插件。 Drupal 使用 sublime 的主要优点: ... 安装 PHP 代码嗅探器 pear install PHP_CodeSniffer 从https://www.drupal.org/project/coder下

    libmon-php:一个响应式网站,展示了基于Aleph的图书馆的最新内容

    库监视器-PHP版本 一个响应式网站,展示了基于Aleph的图书馆的... 在这种情况下,我们建议使用Linux VM。 我们还假定您熟悉所选操作系统上的命令提示符。 ##获取源代码使用git clone https://github.com/bibliocoll/l

    PaloAltoNetworks-Botnet-retrieve-tool

    该脚本称为PEAR(PHP扩展和应用程序存储库),因此您需要预先安装PEAR。 通知电子邮件(电子邮件主题,电子邮件正文)可以自定义为您喜欢的格式。 执行结果记录在“ system.log”中。 每日僵尸网络报告已存档...

    TikiPro Web Framework-开源

    ###项目更名为bitweaver ### CMS,内容包括:tiki&pear Wiki,cms,文章/新闻,phpBB论坛公告板,博客,图片库,文件共享,民意调查/日历,... tikiwiki在Windows和Linux上升级PHP,MySQL,Postgres,Oracle,FireBird

    Puzzle Apps CMS-开源

    用XSLT作为模板引擎PHP开发的内容管理系统。 可以在具有ADODB或PEAR :: DB作为DBAL的不同SQL服务器(MySql,SQLite,PostgreSQL,MSSQL,即Firebird)上运行。 UNIX / Linux之类的权限系统。

    miniEspaider-开源

    miniEspaider 是一个 Linux 发行版,旨在在 USB Key 驱动器上运行。 它的目标是成为 Web 开发人员的开发平台。 它将提供诸如 http(Apache with Pear、PHP、Symfony、Ruby on Rails)、MySQL 等服务。

Global site tag (gtag.js) - Google Analytics