[php-pear]如何使用 PHP-PEAR安装器,以及使用 PEAR 安装扩展库
2016-03-22 18:10
976 查看
我们都知道 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
以下是安装过程的所有提示:(不同的机器上,安装过程出现的提示,不一定完全相同)
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!
相关文章推荐
- PHPEXCEL在thinkphp中封装成类使用
- web PHP判断请求来自PC还是Mobile
- YII通过db执行sql语句可以看下面
- PHP中的字符转义
- laravel提示Mcrypt PHP extension required
- [PHP代码] PHP四舍五入 保留几位小数 格式化数字
- [PHP代码] php模拟post发送数据
- [PHP代码] 用php的fsocket模拟get提交 模拟post提交表单
- FPGA静态时序分析——IO口时序(Input Delay /output Delay)(转载)
- 自定义ContentProvider
- 韩顺平老师讲诉如何学习PHP
- 韩顺平老师讲诉如何学习PHP
- php的预定义数组
- 1.1.4 A+B for Input-Output Practice (V)
- A+B for Input-Output Practice (IV)
- 1.1.3 A+B for Input-Output Practice (III)
- Ubuntu Webstorm/PhpStorm创建桌面快捷启动和菜单文字变粗解决
- phpstudy2016最新版本mysql无法使用innodb的问题解决
- php中将数据加入到文件中
- php判断键值在数组中是否存在