windows系统中安装ubuntu_windows系统中安装 pear

更新时间:2019-08-11    来源:Ubuntu    手机版     字体:

【www.bbyears.com--Ubuntu】

今天简单记录一下我在windows下安装pear的过程,

我的安装环境为win7、wampserver2.4、php5.4.16。

安装步骤

1. 下载 http://pear.php.net/go-pear.phar,我是把下载下来的go-pear.phar文件放到 E:/wamp/bin/pear/ ,因为我打算把pear安装到  E:/wamp/bin/pear/

2. 命令行下运行php go-pear.phar


E:/wamp/bin/pear>php go-pear.phar
 
Are you installing a system-wide PEAR or a local copy?
(system|local) [system] :
3. 输入system,然后回车,出现如下界面:

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)                   : E:/wamp/bin/pear
 2. Temporary directory for processing            : E:/wamp/bin/pear/tmp
 3. Temporary directory for downloads             : E:/wamp/bin/pear/tmp
 4. Binaries directory                            : E:/wamp/bin/pear
 5. PHP code directory ($php_dir)                 : E:/wamp/bin/pear/pear
 6. Documentation directory                       : E:/wamp/bin/pear/docs
 7. Data directory                                : E:/wamp/bin/pear/data
 8. User-modifiable configuration files directory : E:/wamp/bin/pear/cfg
 9. Public Web Files directory                    : E:/wamp/bin/pear/www
10. Tests directory                               : E:/wamp/bin/pear/tests
11. Name of configuration file                    : C:/Windows/pear.ini
12. Path to CLI php.exe                           : E:/wamp/bin/php/php5.4.16
 
1-12, "all" or Enter to continue:
4.默认安装目录结构是如上,如果想改变目录就输入前面色数字,我在这里输入的是11,因为我想将pear.ini文件和php.ini文件放在同一个目录中,输入11后让你填入pear.ini路径,我在这里填入的是  E:/wamp/bin/php/php5.4.16/pea r.ini


1-12, "all" or Enter to continue: 11
(Use $prefix as a shortcut for "E:/wamp/bin/pear", etc.)
Name of configuration file [C:/Windows/pear.ini] : E:/wamp/bin/php/php5.4.16/pear.ini
5. 接下来会出现类似步骤3的界面,此时直接回车就可以了。

6. 接下来是提示是否把修改php.ini,插入包含路径,输入Y,否则要手动修改。

7. 此时界面会提示 Press Enter to continue: ,直接回车就可以了。

8. 将pear添加到环境变量中,如下图


path-pear

9.注册环境变量,执行PEAR_ENV.reg。 10. 测试,在dos中输入 pear help  若能输出很多帮助选项那就是成功安装。再尝试用一些pear功能,如果没问题,恭喜你,pear安装成功了。如果不正常,执行  pear config-show  查看是否配置正确了,如果确保配置正常的话,重启计算机试试。 pear的目录结构 pear-dir   cfg: 用户验证配置文件夹 data: 数据保存文件夹 pear: 主要的PHP文件夹 tests: 测试文件夹 tmp: 临时文件夹 www: 网络文件夹 其中默认cfg www 文件夹是空的,data docs pear 三个文件里面在每一次用pear命令安装一个软件都会在里面建立一个文件夹保存软件的数据,比如笔者安装phpdocumentor ,那么在这三个文件夹里面都会有phpdocumentor文件夹。 卸载或重装
    如果是自定义安装目录的话卸载很简单,把pear安装的目录全部删除,把php安装目录下的pear.ini文件也删除; 否则就要到php安装目录下把找到上面图片的目录和文件一个一个删除。这就是为什么笔者强调自定义安装的原因; 然后重新安装。


如果你想在linux下安装pear,可以访问我之前写的  linux下安装pear。

现在开始安装

$ wget http://pear.php.net/go-pear.phar
$ php go-pear.phar

安装过程会提示配置一些参数,我都是用的默认值


 1. Installation base ($prefix)                   : /usr/local/php
 2. Temporary directory for processing            : /tmp/pear/install
 3. Temporary directory for downloads             : /tmp/pear/install
 4. Binaries directory                            : /usr/local/php/bin
 5. PHP code directory ($php_dir)                 : /usr/local/php/share/pear
 6. Documentation directory                       : /usr/local/php/docs
 7. Data directory                                : /usr/local/php/data
 8. User-modifiable configuration files directory : /usr/local/php/cfg
 9. Public Web Files directory                    : /usr/local/php/www
10. Tests directory                               : /usr/local/php/tests
11. Name of configuration file                    : /usr/local/php/etc/pear.conf

安装完毕之后,来检测一下


# /usr/local/php/bin/pear
Commands:
build                  Build an Extension From C Source
bundle                 Unpacks a Pecl Package
channel-add            Add a Channel
channel-alias          Specify an alias to a channel name
channel-delete         Remove a Channel From the List
......

本文来源:http://www.bbyears.com/caozuoxitong/61421.html

热门标签

更多>>

本类排行