日期:2014-05-17  浏览次数:20762 次

windows下安装pear包管理器

PEAR是PHP扩展与应用库(the PHP Extension and Application Repository)的缩写。它是一个PHP扩展及应用的一个代码仓库,简单地说,PEAR之于PHP就像是CPAN(Comprehensive Perl Archive Network)之于Perl。(摘自pear百度百科)

简单说就是可以供我们使用的代码仓库。有人云程序员都很懒。其实根本意思无非告诉我们有时候不一定每一个技术细节都要我们亲自实现,也要学会站在巨人的肩膀上,可以直接借鉴或使用他人已经实现的成熟代码或者思想,这样也减少出现走弯路的可能,并且经过实践的代码总比重新开发的要安全的多且效率高。

那么如何在windows下安装pear呢?

1.首先,如果你还没有搭建自己的php环境(由于是windows平台,当然php也是for windows的),为了方便,可以使用集成的php环境工具xammp之类的在本机安装。


2.安装好php后,会在php根目录下看到一个go-pear.bat的windows批处理文件。点击执行他,出现提示:

Are you installing a system-wide PEAR or a local copy?
(system|local) [system] :

按下回车,继续... 会出现pear目录设置列表:

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:\php5

 2. Temporary directory for processing            : E:\php5\tmp

 3. Temporary directory for downloads             : E:\php5\tmp

 4. Binaries directory                            : E:\php5

<