在cmd下,cd到php的安装目录,在命令行下输入以下命令读取php
c:\php> php -r "readfile('http://pear.php.net/go-pear');" > go-pear
shell
http://pear.php.net/go-pear,若是提示你的php过于新版,这输入以下的命令,服务器
c:\php> php -r "readfile('http://pear.php.net/go-pear.pear')"ide
在输入c:\php> php go-pear命令svn
这里出现欢迎的页面,按 enter键继续,须提示使用HTTP代理,能够不填ui
HTTP proxy (http://user:password@proxy.myhost.con:port), or Enter for none::.net
接下来直接按Enter,到提示是否修改php.ini文件,Y表示修改,n则表示不修改命令行
安装完成后,安装的程序会在php的安装目录下建立一个PEAR_ENV.reg注册文件来存储当前的环境变量,双击这个文件能够将内容导入到注册表,在命令行下运行PEAR.bar,若是出现以下则表示安装成功代理
Commands:orm
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
channel-discover Initialize a Channel from its server
channel-info Retrieve Information on a Channel
channel-login Connects and authenticates to remote channel serv
channel-logout Logs out from the remote channel server
channel-update Update an Existing Channel
clear-cache Clear Web Services Cache
config-create Create a Default configuration file
config-get Show One Setting
config-help Show Information About Setting
config-set Change Setting
config-show Show All Settings
convert Convert a package.xml 1.0 to package.xml 2.0 form
cvsdiff Run a "cvs diff" for all files in a package
cvstag Set CVS Release Tag
download Download Package
download-all Downloads each available package from the default
info Display information about a package
install Install Package
list List Installed Packages In The Default Channel
list-all List All Packages
list-channels List Available Channels
list-files List Files In Installed Package
list-upgrades List Available Upgrades
login Connects and authenticates to remote server [Depr
n favor of channel-login]
logout Logs out from the remote server [Deprecated in fa
hannel-logout]
makerpm Builds an RPM spec file from a PEAR package
package Build Package
package-dependencies Show package dependencies
package-validate Validate Package Consistency
pickle Build PECL Package
remote-info Information About Remote Packages
remote-list List Remote Packages
run-scripts Run Post-Install Scripts bundled with a package
run-tests Run Regression Tests
search Search remote package database
shell-test Shell Script Test
sign Sign a package distribution file
svntag Set SVN Release Tag
uninstall Un-install Package
update-channels Update the Channel List
upgrade Upgrade Package
upgrade-all Upgrade All Packages [Deprecated in favor of call
ade with no parameters]
Usage: pear [options] command [command-options] <parameters>
Type "pear help options" to list all options.
Type "pear help shortcuts" to list all command shortcuts.
Type "pear help <command>" to get the help for the specified command.
经常使用的命令
查看服务器已安装的pear包: pear list
查看某个包的详细信息 :pear info 包名
安装一个pear包:pear install 包名
安装包能够经过访问pear官网下载相应的包,再将其解压到相应的文件夹下便可,
注意:有些包是相互依赖的,如:auth_http就依赖与auth包,安装时要注意,使用命令行能够自动的安装所依赖的包