[php-pear]如何使用 PHP-PEAR安装器,以及使用 PEAR 安装扩展库
我们都知道 PHP PEAR,就是 PHP Extension and Application Respository,也就是 PHP 扩展和应用代码库。
PHP 也可以通过 PEAR 安装器来进行 library package 的安装,那么首先是去安装:PEAR 安装器;然后通过安装器安装你想要安装的扩展包。
Getting and installing the PEAR package manager,安装 PEAR 安装器:
https://pear.php.net/manual/en/installation.getting.php
安装扩展包,如:以 Net_GeoIP(https://pear.php.net/package/Net_GeoIP/docs/latest/Net_GeoIP/Net_GeoIP.html) 安装包作为实例。
pear install Net_GeoIP 即可。
Install package:
https://pear.php.net/manual/en/guide.users.commandline.installing.php
以下是安装过程的所有提示:(不同的机器上,安装过程出现的提示,不一定完全相同)
// 安装过程
// 机器 1
---------------
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
2. Temporary directory for processing : /tmp/pear/install
3. Temporary directory for downloads : /tmp/pear/install
4. Binaries directory : /usr/bin
5. PHP code directory ($php_dir) : /usr/share/php
6. Documentation directory : /usr/docs
7. Data directory : /usr/data
8. User-modifiable configuration files directory : /usr/cfg
9. Public Web Files directory : /usr/www
10. System manual pages directory : /usr/man
11. Tests directory : /usr/tests
12. Name of configuration file : /etc/pear.conf // 机器 2---------
ubuntu@VM-244-206-ubuntu:~$ sudo wget http://pear.php.net/go-pear.phar
[sudo] password for ubuntu:
Sorry, try again.
[sudo] password for ubuntu:
--2016-03-22 17:39:05-- http://pear.php.net/go-pear.phar
Resolving pear.php.net (pear.php.net)... 109.203.101.62
Connecting to pear.php.net (pear.php.net)|109.203.101.62|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3566292 (3.4M) [text/plain]
Saving to: ‘go-pear.phar’ 100%[========================================================================================================>] 3,566,292 1.16MB/s in 2.9s 2016-03-22 17:39:09 (1.16 MB/s) - ‘go-pear.phar’ saved [3566292/3566292] ubuntu@VM-244-206-ubuntu:~$ php go-pear.phar 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) : /home/ubuntu/pear
2. Temporary directory for processing : /tmp/pear/install
3. Temporary directory for downloads : /tmp/pear/install
4. Binaries directory : /home/ubuntu/pear/bin
5. PHP code directory ($php_dir) : /home/ubuntu/pear/share/pear
6. Documentation directory : /home/ubuntu/pear/docs
7. Data directory : /home/ubuntu/pear/data
8. User-modifiable configuration files directory : /home/ubuntu/pear/cfg
9. Public Web Files directory : /home/ubuntu/pear/www
10. System manual pages directory : /home/ubuntu/pear/man
11. Tests directory : /home/ubuntu/pear/tests
12. Name of configuration file : /home/ubuntu/.pearrc 1-12, 'all' or Enter to continue:
Beginning install...
Configuration written to /home/ubuntu/.pearrc...
Initialized registry...
Preparing to install...
installing phar:///home/ubuntu/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.4.0.tar...
installing phar:///home/ubuntu/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.4.1.tar...
installing phar:///home/ubuntu/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.10.1.tar...
installing phar:///home/ubuntu/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.1.1.tar...
installing phar:///home/ubuntu/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.3.0.tar...
install ok: channel://pear.php.net/Archive_Tar-1.4.0
install ok: channel://pear.php.net/Console_Getopt-1.4.1
install ok: channel://pear.php.net/Structures_Graph-1.1.1
install ok: channel://pear.php.net/XML_Util-1.3.0
install ok: channel://pear.php.net/PEAR-1.10.1
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! The include_path defined in the currently used php.ini does not
contain the PEAR PHP directory you just specified:
</home/ubuntu/pear/share/pear>
If the specified directory is also not in the include_path used by
your scripts, you will have problems getting any PEAR packages working. Would you like to alter php.ini </etc/php5/cli/php.ini>? [Y/n] : y php.ini </etc/php5/cli/php.ini> include_path updated. Current include path : .:/usr/share/php:/usr/share/pear
Configured directory : /home/ubuntu/pear/share/pear
Currently used php.ini (guess) : /etc/php5/cli/php.ini
Press Enter to continue: ** WARNING! Old version found at /home/ubuntu/pear/bin, please remove it or be sure to use the new /home/ubuntu/pear/bin/pear command The 'pear' command is now at your service at /home/ubuntu/pear/bin/pear ** The 'pear' command is not currently in your PATH, so you need to
** use '/home/ubuntu/pear/bin/pear' until you have added
** '/home/ubuntu/pear/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/ Thanks for using go-pear!
[php-pear]如何使用 PHP-PEAR安装器,以及使用 PEAR 安装扩展库的更多相关文章
- 编译安装PHP以及需要的基本扩展库(php7.4)
安装配置选项1: ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-curl --with-freety ...
- 小米4 miui专用 Xposed安装器86版
转载自 http://www.52pojie.cn/thread-516435-1-1.html 写在前面:各位用xp受到不同限制,有些机型还找不到框架包,又要刷第三方rec又要谨慎选择框架版本.官方 ...
- 编写Windows服务疑问2:探索服务与安装器的关系
首先,来弄两个服务,一个叫“飞机”,一个叫“火车”. public class FeiJiService : ServiceBase { public FeiJiService() { Service ...
- 谷歌安装器扫描时提示“需要root权限”,不用root也可以的!
能FQ的用户会用谷歌服务,一般的新手机没有安装谷歌框架,但是在用谷歌安装器安装谷歌市场时会提示"需要root权限",我用的是360手机,按照下面的教程搞好了: 安装完GSM包就可以 ...
- Android 7.0 安装器安装过程分析 (com.android.packageinstaller)
1 安装入口PackageInstallerActivity,这个类只是在安装前做准备.通过各种校验,然后弹出被安装应用的权限框,等待用户安装.具体的流程如下 1.1 求mSessionId 如果是 ...
- 如何使用ZOL一键安装器下载中关村在线的源安装包
如何使用ZOL一键安装器下载中关村在线的源安装包 马根峰 (广东联合电子服务股份有限公司, 广州 510300) 摘要 中关村在线最近开始推出ZOL一键安装器,用户直 ...
- 拇指玩」制作的「谷歌安装器」app
作者:匿名用户链接:https://www.zhihu.com/question/57468448/answer/153000587来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请 ...
- 怎样使用ZOL一键安装器下载中关村在线的源安装包
怎样使用ZOL一键安装器下载中关村在线的源安装包 马根峰 (广东联合电子服务股份有限公司, 广州 510300) 摘要 中关村在线近期開始推出ZOL一键安装器,用户直 ...
- Clipboard Action for Mac(智能剪贴板历史管理器)破解版安装
1.软件简介 Clipboard Action 是 macOS 系统上一款智能剪贴板历史管理器,它允许剪贴板历史中的每一段内容执行操作.使用 AppleScript 或 Automator 工作 ...
随机推荐
- 1.1 Java 的概述
[什么是java]:Java是一种可以撰写跨平台应用软件的面向对象的程序设计语言,是有SunMicrosystems公司于1995年5月推出的Java程序设计语言和Java平台(即JavaSE,Jav ...
- 大神的P图过程!快来偷窥!
来自美国的艺术家James(@jameasons) 平时我们总是能看到一些大神合成出这样的图片, 但是他们P图的过程是怎样的,很多人都是不知道的. 接下来再看看这位大神的其他作品, 如果你看了上面视频 ...
- UI设计教程分享:关于海报的合成过程
一张好的产品创意合成海报,能瞬间提升商品价值感,同时场景和相关元素的融入,让消费者瞬间明白商品属性及内涵.同时为商品营造的使用场景拥有更强的代入感,从而刺激转化.好的创意合成海报能为消费者带来视觉冲击 ...
- proguard-rules.pro、混淆、导jar包
前记: 买了一个<精通Android Studio>本来最想看的是关于混淆导jar包的,哪知道没有,有点小失望. 好吧,自己来. 在用Android Studio开发的时候,把minify ...
- 7-性能测试i报告
性能测试报告概述 1.测试报告是指把测试的过程和结果写成文档:对发现的问题和缺陷进行分析:为纠正软件的存在的质量问题提供依据: 为软件验收和交付打下基础 2.性能测试报告属于软件测试报告的一种,主要针 ...
- UVA 10405 Longest Common Subsequence
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=16&p ...
- [html]Sublime Text添加插件
今天想在Sublime Text(简称ST)内编写HTML后直接使用浏览器看效果,想添加View in Browser插件,然后遇到奇怪的问题添加插件直接报"找不到有用的插件" 一 ...
- spring学习七 spring和dynamic project进行整合
spring和web项目进行整合,其实就是在项目启动时,就创建spring容器,然后在servlet中使用spring容器进行开. 注意:为了页面可以访问到servlet,因此servlet必须放进t ...
- 如何为终端用提供更快的解决方案?让IT技术员具备更高的效率?
- kbmmw 中的进程管理小工具
kbmmw 5.6.20 发布了,本版本带来一个小功能,就是可以在kbmmw 应用里面建立和管理进程, 虽然你可以直接调用windows api 做类似的事情,但是kbmmw 里面简化了操作,也加强了 ...