在cmd下,cd到php的安装目录,在命令行下输入如下命令读取
c:\php> php -r "readfile('http://pear.php.net/go-pear');" > go-pear
http://pear.php.net/go-pear,如果提示你的php过于新版,这输入如下的命令,
c:\php> php -r "readfile('http://pear.php.net/go-pear.pear')"
在输入c:\php> php go-pear命令
这里出现欢迎的页面,按 enter键继续,须提示使用HTTP代理,可以不填
HTTP proxy (http://user:[email protected]:port), or Enter for none::
接下来直接按Enter,到提示是否修改php.ini文件,Y表示修改,n则表示不修改
安装完成后,安装的程序会在php的安装目录下创建一个PEAR_ENV.reg注册文件来存储当前的环境变量,双击这个文件可以将内容导入到注册表,在命令行下运行PEAR.bar,如果出现如下则表示安装成功
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
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]
Type "pear help options" to list all options.
Type "pear help shortcuts" to list all command shortcuts.
Type "pear help
常用的命令
查看服务器已安装的pear包: pear list
查看某个包的详细信息 :pear info 包名
安装一个pear包:pear install 包名
安装包可以通过访问pear官网下载相应的包,再将其解压到相应的文件夹下即可,
注意:有些包是相互依赖的,如:auth_http就依赖与auth包,安装时要注意,使用命令行可以自动的安装所依赖的包