在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] <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包,安裝時要注意,使用命令行可以自動的安裝所依賴的包