?PHP5.2.17以后版本:
wget http://pear.php.net/go-pear.phar
chmod 700 go-pear.phar
/usr/local/php52/bin/php go-pear.phar
(安装过程同老版本)
which pear查看pear命令位置,并用pear安装phpdoc
/usr/local/php52/bin/pear install phpdoc
如果提示无法下载,则手动下载PHPDoc-0.1.0.tgz
wget http://download.pear.php.net/package/PHPDoc-0.1.0.tgz指定安装:/usr/local/php52/bin/pear install ./PHPDoc-0.1.0.tgz
(完成)
================另一种情况==============================
[root@localhost php-java-bridge-5.5.4.1]# /usr/local/bin/pear install phpdocFailed to download pear/phpdoc within preferred state "stable", latest release is version 0.1.0, stability "beta", use "channel://pear.php.net/phpdoc-0.1.0" to installinstall failed[root@localhost php-java-bridge-5.5.4.1]# /usr/local/bin/pear install channel://pear.php.net/phpdoc-0.1.0WARNING: "pear/PHPDoc" is deprecated in favor of "pear/PhpDocumentor"WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to updatedownloading PHPDoc-0.1.0.tar ...Starting to download PHPDoc-0.1.0.tar (Unknown size).........................................................................................................................done: 598,528 bytesinstall ok: channel://pear.php.net/PHPDoc-0.1.0
(phpdoc安装完成)
安装pear需要使用php命令来执行一个go-pear.php的文件来完成:
go-pear.php文件的获取:
访问:http://pear.php.net/go-pear
将整个网页内容复制下来并存储为go-pear.php即可。
我们这里可以使用vim命令建立go-pear.php文件,将内容复制进去,保存,增加执行权限即可。
用php命令执行go-pear.php:
/usr/local/php/bin/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::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/downloads/jdk 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: 我们可以在命令行后输入1-7和all或者直接回车继续,
正品团购
我们这里选择输入all,回车。
上一步选择all以后,就要对每一项的安装目录进行定义,这个根据变量提示来确定,这里之定义了四项,定义一项回车一次:
1-7, 'all' or Enter to continue: all
Installation prefix ($prefix) [/root/downloads/jdk] :
Temporary files directory [$prefix/temp] :
Binaries directory [$prefix/bin] : /usr/bin
PHP code directory ($php_dir) [$prefix/PEAR] : /usr/local/php/bin
Documentation base directory [$php_dir/docs] : /usr/local/php/docs
Data base directory [$php_dir/data] : /usr/local/php/data
Tests base directory [$php_dir/tests] :
回车后,返回刚才定义的信息:
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/downloads/jdk
2. Temporary files directory : $prefix/temp
3. Binaries directory : /usr/bin
4. PHP code directory ($php_dir) : /usr/local/php/bin
5. Documentation base directory : /usr/local/php/docs
6. Data base directory : /usr/local/php/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 "doc.php.net"
Update of Channel "doc.php.net" succeeded
Updating channel "pear.php.net"
Update of Channel "pear.php.net" succeeded
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded
Installing selected packages..................
Downloading and installing package: PEAR.............warning: pear/PEAR requires package "pear/Archive_Tar" (recommended version 1.3.7)
warning: pear/PEAR requires package "pear/Structures_Graph" (recommended version 1.0.3)
warning: pear/PEAR requires package "pear/Console_Getopt" (recommended version 1 .2.3)
warning: pear/PEAR requires package "pear/XML_Util" (recommended version 1.2.1)
downloading PEAR-1.9.1.tgz ...
Starting to download PEAR-1.9.1.tgz (293,587 bytes) ......................................done: 293,587 bytes install ok: channel://pear.php.net/PEAR-1.9.1 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.3 Downloading and installing package: Archive_Tar-stable.......downloading Archive_Tar-1.3.7.tgz ... Starting to download Archive_Tar-1.3.7.tgz (17,610 bytes) ...done: 17,610 bytes install ok: channel://pear.php.net/Archive_Tar-1.3.7 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.4.tgz ... Starting to download PEAR_Frontend_Web-0.7.4.tgz (53,321 bytes) ...done: 53,321 bytes downloading HTML_Template_IT-1.3.0.tgz ... Starting to download HTML_Template_IT-1.3.0.tgz (23,309 bytes) ...done: 23,309 bytes install ok: channel://pear.php.net/HTML_Template_IT-1.3.0 install ok: channel://pear.php.net/PEAR_Frontend_Web-0.7.4 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 (27,939 bytes) ...done: 27,939 bytes downloading MIME_Type-1.2.0.tgz ... Starting to download MIME_Type-1.2.0.tgz (11,581 bytes) ...done: 11,581 bytes install ok: channel://pear.php.net/Config-1.10.11 install ok: channel://pear.php.net/MIME_Type-1.2.0 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/downloads/jdk/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. 到这里提示如下,提示是否更改php.ini文件
Would you like to alter php.ini </usr/local/apache2/conf/php.ini>? [Y/n] :
选择Y,继续:
php.ini </usr/local/apache2/conf/php.ini> include_path updated.
Current include path : .:/usr/local/php/lib/php
Configured directory : /root/downloads/jdk/PEAR
Currently used php.ini (guess) : /usr/local/apache2/conf/php.ini
Press Enter to continue:
回车,继续,出现提示的地方就按照提示输入信息继续,直到完成www.cn403.com!
信团网服装团购网
四、用pear list可以查看安装了的pear包:
Package Version State
Archive_Tar 1.3.7 stable
Config 1.10.11 stable
Console_Getopt 1.2.3 stable
HTML_Template_IT 1.3.0 stable
MDB2 2.4.1 stable
MIME_Type 1.2.0 stable
PEAR 1.9.1 stable
PEAR_Frontend_Web 0.7.4 beta
Structures_Graph 1.0.3 stable
四、安装完了pear
后,使用pear
来安装PhpDocumentor
首先查找到pear安装位置:
find / -name pear
结果:
/usr/bin/pear
执行安装:
/usr/bin/pear install PhpDocumentor
Did not download optional dependencies: pear/XML_Beautifier, use --alldeps to download automatically
pear/PhpDocumentor can optionally use package "pear/XML_Beautifier" (version >= 1.1)
downloading PhpDocumentor-1.4.3.tgz ...
Starting to download PhpDocumentor-1.4.3.tgz (2,423,486 bytes)
..........
当出现如下信息的时候就说明phpdoc安装完成了:
install ok: channel://pear.php.net/PhpDocumentor-1.4.3