close

/* pear的安裝程序 */

《windows 下安裝程序》

1、下載安裝腳本
‧http://go-pear.org/ 或是 http://pear.php.net/go-pear
‧將會在瀏覽器畫面上看到pear的安裝腳本,另存新檔,並命名為go-pear.php。

2、安裝pear套件管理工具
‧在c:php目錄下開新目錄,命名為pear。(或是其他目錄也可以,因為pear是與php相依的套件,所以安裝到php目錄下,以方便管理)
‧將go-pear.php複製到c:phppear下。
‧執行cmd開啟命令列視窗,輸入指令
C:>c:phpphp go-pear.php
或是 C:>php go-pear.php (已設定環境變數將php路徑加入的話)
→【設定環境變數】控制台/系統/進階/環境變數
→編輯系統變數Path
→加入C:PHP;c:PHP;
‧開始連結到pear網站下載套件。
‧命令列出現提示----

-----------------------------------------------------------------------
- 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.
- Use 'php c:phppeargo-pear.php local' to install a local copy of PEAR.
- Go-pear also lets you download and install the PEAR packages bundled
- with PHP: DB, Net_Socket, Net_SMTP, Mail, XML_Parser, PHPUnit.
- If you wish to abort, press Control-C now, or press Enter to continue:
-------------------------------------------------------------------------
‧按enter繼續

-----------------------------------------------------------------------
- HTTP proxy (http://user:password@proxy.myhost.com:port), or Enter for none::
-------------------------------------------------------------------------
‧詢問是否是經過proxy上網,不是,按enter繼續

-----------------------------------------------------------------------
*NOTICE*
We found php.exe under c:phpphp.exe, it uses a cgi SAPI. PEAR commandline
tool works well with it, if you have a CLI php.exe available, we
recommand to use it.

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 : c:phppear
2. Binaries directory : $prefix
3. PHP code directory ($php_dir) : $prefixpear
4. Documentation base directory : $php_dirdocs
5. Data base directory : $php_dirdata
6. Tests base directory : $php_dirtests
7. php.exe path : c:phpphp.exe

1-7, 'all' or Enter to continue:
-------------------------------------------------------------------------
‧設定安裝路徑,$prefix是pear套件管理工具安裝的目錄,$php_dir是pear套件安裝的目錄(包含套件程式及說明文件)。
‧若不修改,按enter繼續

-----------------------------------------------------------------------
The following PEAR packages are bundled with PHP: DB, Net_Socket, Net_SMTP,
Mail, XML_Parser, PHPUnit.
Would you like to install these as well? [Y/n] : y
-------------------------------------------------------------------------
‧是否繼續安裝,按y繼續

-----------------------------------------------------------------------
Loading zlib: ok
Downloading package: PEAR-stable......ok
Downloading package: Archive_Tar-stable....ok
Downloading package: Console_Getopt-stable....ok
Downloading package: XML_RPC-stable....ok
Bootstrapping: PEAR...................(remote) ok
Bootstrapping: Archive_Tar............(remote) ok
Bootstrapping: Console_Getopt.........(remote) ok
Downloading package: DB...............ok
Downloading package: Net_Socket.......ok
Downloading package: Net_SMTP.........ok
Downloading package: Mail.............ok
Downloading package: XML_Parser.......ok
Downloading package: PHPUnit..........ok
Extracting installer..................ok
install ok: PEAR 1.3.6
install ok: Archive_Tar 1.3.1
install ok: Console_Getopt 1.2
install ok: XML_RPC 1.4.0
install ok: DB 1.7.6
install ok: Net_Socket 1.0.6
install ok: Net_SMTP 1.2.7
install ok: Mail 1.1.8
install ok: XML_Parser 1.2.6
install ok: PHPUnit 1.3.0

******************************************************************************
WARNING! The include_path defined in the currently used php.ini does not
contain the PEAR PHP directory you just specified:
<c:phppearpear>
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 <C:WINNTphp.ini>? [Y/n] : y
-------------------------------------------------------------------------
‧下載套件並安裝
‧是否修改php.ini中include_path,按y繼續

-------------------------------------------------------------------------
php.ini <C:WINNTphp.ini> include_path updated.

Current include path : .;c:php4pear
Configured directory : c:phppearpear
Currently used php.ini (guess) : C:WINNTphp.ini
Press Enter to continue:

The 'pear' command is now at your service at c:phppearpear.bat

** The 'pear' command is not currently in your PATH, so you need to
** use 'c:phppearpear.bat' until you have added
** 'c:phppear' 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://cvs.php.net/co.php/pearweb/doc/pear_package_manager.txt?p=1
http://pear.php.net/manual/

Thanks for using go-pear!



* WINDOWS ENVIRONMENT VARIABLES *
For convenience, a REG file is available under c:phppearPEAR_ENV.reg .
This file creates ENV variables for the current user.

Double-click this file to add it to the current user registry.
-------------------------------------------------------------------------
‧安裝完成。
‧在pear安裝目錄下有一註冊檔,c:phppearPEAR_ENV.reg按右鍵→合併,將pear相關環境變數加入註冊檔。
‧設定環境變數,將pear路徑加入path環境變數,以後就可以直接在命令列視窗打pear執行命令,不需再打完整路徑。
→【設定環境變數】控制台/系統/進階/環境變數
→編輯系統變數Path
→加入C:PHPpear;c:PHPpear;
‧命令列視窗,輸入指令測試是否安裝成功
C:>pear list (列出目前已安裝的pear套件)

-------------------------------------------------------------------------
INSTALLED PACKAGES:
===================
PACKAGE VERSION STATE
Archive_Tar 1.3.1 stable
Console_Getopt 1.2 stable
DB 1.7.6 stable
Mail 1.1.8 stable
Net_SMTP 1.2.7 stable
Net_Socket 1.0.6 stable
PEAR 1.3.6 stable
PHPUnit 1.3.0 stable
XML_Parser 1.2.6 stable
XML_RPC 1.4.0 stable
-------------------------------------------------------------------------
‧出現以上結果即是安裝成功。

arrow
arrow
    全站熱搜

    yoonow 發表在 痞客邦 留言(0) 人氣()