在Linux下安装PHP的PEAR,其实不复杂,怎么搜了一下,网上好多介绍,看起来都是一样的文章,其实很简单的。
1)下载
curl -o go-pear.php http://pear.php.net/go-pear
2)运行go-pear.php
debian:~# php go-pear.php
3)这里按回车继续安装,CTRL+C放弃安装。
If you wish to abort, press Control-C now, or press Enter to continue:
4)有没有代理,没有代理直接回车
HTTP proxy (http://user:password@proxy.myhost.com:port), or Enter for none::
安装路径,默认回车
1. Installation prefix ($prefix) : /root
2. Temporary files directory : $prefix/temp
3. Binaries directory : $prefix/bin
4. PHP code directory ($php_dir) : $prefix/PEAR
5. Documentation base directory : $php_dir/docs
6. Data base directory : $php_dir/data
7. Tests base directory : $php_dir/tests
1-7, ‘all’ or Enter to continue:
按Y
Would you like to install these as well? [Y/n] :
然后就直接安装了。
安装的全过程在这里
- debian:~# php go-pear.php
-
- Welcome to go-pear!
-
-
-
- Go-pear will install the 'pear' command and all the files needed by
-
- it. This command is your tool for PEAR installation and maintenance.
-
-
-
- Go-pear also lets you download and install the following optional PEAR
-
- packages: PEAR_Frontend_Web-beta, PEAR_Frontend_Gtk2, MDB2.
-
-
-
-
-
- If you wish to abort, press Control-C now, or press Enter to continue:
-
-
-
- HTTP proxy (http://user:password@proxy.myhost.com:port), or Enter for none::
-
-
-
- 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 prefix ($prefix) : /root
-
- 2. Temporary files directory : $prefix/temp
-
- 3. Binaries directory : $prefix/bin
-
- 4. PHP code directory ($php_dir) : $prefix/PEAR
-
- 5. Documentation base directory : $php_dir/docs
-
- 6. Data base directory : $php_dir/data
-
- 7. Tests base directory : $php_dir/tests
-
-
-
- 1-7, 'all' or Enter to continue:
-
-
-
- The following PEAR packages are bundled with PHP: PEAR_Frontend_Web-beta,
-
- PEAR_Frontend_Gtk2, MDB2.
-
- Would you like to install these as well? [Y/n] : Y
-
-
-
- Loading zlib: ok
-
-
-
- Bootstrapping Installer...................
-
- Bootstrapping PEAR.php............(remote) ok
-
- Bootstrapping Archive/Tar.php............(remote) ok
-
- Bootstrapping Console/Getopt.php............(remote) ok
-
-
-
- Extracting installer..................
-
- Downloading package: PEAR.............ok
-
- Downloading package: Structures_Graph....ok
-
-
-
- Preparing installer..................
-
- Updating channel "pear.php.net"
-
- Channel "pear.php.net" is up to date
-
- Updating channel "pecl.php.net"
-
- Channel "pecl.php.net" is up to date
-
-
-
- Installing selected packages..................
-
- Downloading and installing package: PEAR.............warning: pear/PEAR requires package "pear/Archive_Tar" (recommended version 1.3.2)
-
- warning: pear/PEAR requires package "pear/Structures_Graph" (recommended version 1.0.2)
-
- warning: pear/PEAR requires package "pear/Console_Getopt" (recommended version 1.2.3)
-
- pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)
-
- downloading PEAR-1.7.2.tgz ...
-
- Starting to download PEAR-1.7.2.tgz (302,744 bytes)
-
- .........................................done: 302,744 bytes
-
- install ok: channel://pear.php.net/PEAR-1.7.2
-
- PEAR: Optional feature webinstaller available (PEAR's web-based installer)
-
- PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
-
- PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
-
- PEAR: To install optional features use "pear install pear/PEAR#featurename"
-
- Installing bootstrap package: Structures_Graph.......install ok: channel://pear.php.net/Structures_Graph-1.0.2
-
- Downloading and installing package: Archive_Tar-stable.......downloading Archive_Tar-1.3.2.tgz ...
-
- Starting to download Archive_Tar-1.3.2.tgz (17,150 bytes)
-
- ...done: 17,150 bytes
-
- install ok: channel://pear.php.net/Archive_Tar-1.3.2
-
- Downloading and installing package: Console_Getopt-stable.......downloading Console_Getopt-1.2.3.tgz ...
-
- Starting to download Console_Getopt-1.2.3.tgz (4,011 bytes)
-
- ...done: 4,011 bytes
-
- install ok: channel://pear.php.net/Console_Getopt-1.2.3
-
- Downloading and installing package: PEAR_Frontend_Web-beta.......downloading PEAR_Frontend_Web-0.7.3.tgz ...
-
- Starting to download PEAR_Frontend_Web-0.7.3.tgz (53,152 bytes)
-
- ...done: 53,152 bytes
-
- downloading HTML_Template_IT-1.2.1.tgz ...
-
- Starting to download HTML_Template_IT-1.2.1.tgz (21,565 bytes)
-
- ...done: 21,565 bytes
-
- install ok: channel://pear.php.net/HTML_Template_IT-1.2.1
-
- install ok: channel://pear.php.net/PEAR_Frontend_Web-0.7.3
-
- Downloading and installing package: PEAR_Frontend_Gtk2.......Did not download optional dependencies: pear/XML_Parser, pear/XML_Util, use --alldeps to download automatically
-
- Did not download optional dependencies: pear/System_Command, use --alldeps to download automatically
-
- pear/PEAR_Frontend_Gtk2 requires PHP extension "php-gtk" (version >= 2.0.0dev)
-
- pear/Config can optionally use package "pear/XML_Parser"
-
- pear/Config can optionally use package "pear/XML_Util"
-
- pear/Gtk2_EntryDialog requires PHP extension "php-gtk" (version >= 2.0.0dev)
-
- pear/Gtk2_FileDrop requires PHP extension "php-gtk" (version >= 2.0.0dev)
-
- pear/MIME_Type can optionally use package "pear/System_Command"
-
- downloading Config-1.10.11.tgz ...
-
- Starting to download Config-1.10.11.tgz (0 bytes)
-
- ...done: 0 bytes
-
- could not extract the package.xml file from "/root/temp/download/Config-1.10.11.tgz"
-
- Download of "pear/Config" succeeded, but it is not a valid package archive
-
- Error: cannot download "pear/Config"
-
- downloading MIME_Type-1.1.3.tgz ...
-
- Starting to download MIME_Type-1.1.3.tgz (8,805 bytes)
-
- ...done: 8,805 bytes
-
- install ok: channel://pear.php.net/MIME_Type-1.1.3
-
- Downloading and installing package: MDB2.............downloading MDB2-2.4.1.tgz ...
-
- Starting to download MDB2-2.4.1.tgz (119,790 bytes)
-
- ...done: 119,790 bytes
-
- install ok: channel://pear.php.net/MDB2-2.4.1
-
- MDB2: Optional feature fbsql available (Frontbase SQL driver for MDB2)
-
- MDB2: Optional feature ibase available (Interbase/Firebird driver for MDB2)
-
- MDB2: Optional feature mysql available (MySQL driver for MDB2)
-
- MDB2: Optional feature mysqli available (MySQLi driver for MDB2)
-
- MDB2: Optional feature mssql available (MS SQL Server driver for MDB2)
-
- MDB2: Optional feature oci8 available (Oracle driver for MDB2)
-
- MDB2: Optional feature pgsql available (PostgreSQL driver for MDB2)
-
- MDB2: Optional feature querysim available (Querysim driver for MDB2)
-
- MDB2: Optional feature sqlite available (SQLite2 driver for MDB2)
-
- MDB2: To install optional features use "pear install pear/MDB2#featurename"
-
-
-
- ******************************************************************************
-
- WARNING! The include_path defined in the currently used php.ini does not
-
- contain the PEAR PHP directory you just specified:
-
- </root/PEAR>
-
- If the specified directory is also not in the include_path used by
-
- your scripts, you will have problems getting any PEAR packages working.
-
-
-
-
-
- Would you like to alter php.ini </etc/php5/cli/php.ini>? [Y/n] : y
-
-
-
- php.ini </etc/php5/cli/php.ini> include_path updated.
-
-
-
- Current include path : .:/usr/share/php:/usr/share/pear
-
- Configured directory : /root/PEAR
-
- Currently used php.ini (guess) : /etc/php5/cli/php.ini
-
- Press Enter to continue:
-
-
-
- The 'pear' command is now at your service at /root/bin/pear
-
-
-
- ** The 'pear' command is not currently in your PATH, so you need to
-
- ** use '/root/bin/pear' until you have added
-
- ** '/root/bin' to your PATH environment variable.
-
-
-
- Run it without parameters to see the available actions, try 'pear list'
-
- to see what packages are installed, or 'pear help' for help.
-
-
-
- For more information about PEAR, see:
-
-
-
- http://pear.php.net/faq.php
-
- http://pear.php.net/manual/
-
-
-
- Thanks for using go-pear!