Windows下为php5.3.10安装PEAR

1.打开http://pear.php.net/go-pear将该页面保存成php文件
2.在命令行下运行“php go-pear.php”,如果出错的话他会提示你,比如让你去http://pear.php.net/go-pear.phar下载更新的go-pear文件
3.运行后提示界面
H:\php-5.3.10>php go-pear.phar
Are you installing a system-wide PEAR or a local copy?
(system|local) [system] : local #我选择的是local
Please confirm local copy by typing ‘yes’ : yes
接着提示
1. Installation base ($prefix)                   : H:\php-5.3.10
2. Temporary directory for processing            : H:\php-5.3.10\tmp
3. Temporary directory for downloads             : H:\php-5.3.10\tmp
4. Binaries directory                            : H:\php-5.3.10
5. PHP code directory ($php_dir)                 : H:\php-5.3.10\pear
6. Documentation directory                       : H:\php-5.3.10\docs
7. Data directory                                : H:\php-5.3.10\data
8. User-modifiable configuration files directory : H:\php-5.3.10\cfg
9. Public Web Files directory                    : H:\php-5.3.10\www
10. Tests directory                               : H:\php-5.3.10\tests
11. Name of configuration file                    : H:\php-5.3.10\pear.ini
12. Path to CLI php.exe                           : H:\php-5.3.10

1-12, ‘all’ or Enter to continue:
可以选择修改上面的配置,输入all将会让你配置1-12的路径,如果不改的话按回车
4.修改php.ini文件include_path = “.;H:\php-5.3.10\pear” 改成你的pear目录

看下pear可用的命令
运行pear help
H:\php-5.3.10>pear help
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 server
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 format
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 channel

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 [Deprecated i
n favor of channel-login]
logout                 Logs out from the remote server [Deprecated in favor of c
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 calling upgr
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.