Windows 版PHPを使う場合は……

WindowsPHPを使う場合は、インストール位置は C:\php にしないと色々設定が面倒くさい(pearとか)。
とりあえずメモ。

#### go-pear.bat の
#### %PHP_BIN% -d output_buffering=0 PEAR\go-pear.phar
#### と書いてある行に -d phar.require_hash=0 を追加して
#### %PHP_BIN% -d output_buffering=0 -d phar.require_hash=0 PEAR\go-pear.phar
#### となるように直して
> go-pear.bat

Are you installing a system-wide PEAR or a local copy?
(system|local) [system] :

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 base ($prefix)                   : C:\Programs\php-5.3.5-Win32-VC6-x86
 2. Temporary directory for processing            : C:\Programs\php-5.3.5-Win32-VC6-x86\tmp
 3. Temporary directory for downloads             : C:\Programs\php-5.3.5-Win32-VC6-x86\tmp
 4. Binaries directory                            : C:\Programs\php-5.3.5-Win32-VC6-x86
 5. PHP code directory ($php_dir)                 : C:\Programs\php-5.3.5-Win32-VC6-x86\pear
 6. Documentation directory                       : C:\Programs\php-5.3.5-Win32-VC6-x86\docs
 7. Data directory                                : C:\Programs\php-5.3.5-Win32-VC6-x86\data
 8. User-modifiable configuration files directory : C:\Programs\php-5.3.5-Win32-VC6-x86\cfg
 9. Public Web Files directory                    : C:\Programs\php-5.3.5-Win32-VC6-x86\www
10. Tests directory                               : C:\Programs\php-5.3.5-Win32-VC6-x86\tests
11. Name of configuration file                    : C:\WINDOWS\pear.ini
12. Path to CLI php.exe                           : .

1-12, 'all' or Enter to continue:
'".\php.exe"' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。

*WARNING*
We found php.exe under ., it uses an unknown SAPI. PEAR commandline
tool has not been tested with it, if you have a CLI (or CGI) php.exe available,
we strongly recommend using it.

Beginning install...
Configuration written to C:\WINDOWS\pear.ini...
Initialized registry...
Preparing to install...
installing phar://C:/Programs/php-5.3.5-Win32-VC6-x86/PEAR/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3.3.tar...
installing phar://C:/Programs/php-5.3.5-Win32-VC6-x86/PEAR/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.2.3.tar...
installing phar://C:/Programs/php-5.3.5-Win32-VC6-x86/PEAR/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.8.0.tar...
installing phar://C:/Programs/php-5.3.5-Win32-VC6-x86/PEAR/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.2.tar...
installing phar://C:/Programs/php-5.3.5-Win32-VC6-x86/PEAR/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.2.1.tar...
install ok: channel://pear.php.net/Archive_Tar-1.3.3
install ok: channel://pear.php.net/Console_Getopt-1.2.3
ERROR: unable to unpack phar://C:/Programs/php-5.3.5-Win32-VC6-x86/PEAR/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.2.tar
install ok: channel://pear.php.net/XML_Util-1.2.1
install ok: channel://pear.php.net/PEAR-1.8.0
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"

** WARNING! Old version found at C:\Programs\php-5.3.5-Win32-VC6-x86, please remove it or be sure to use the new c:\programs\php-5.3.5-win32-vc6-x86\pear.bat command

The 'pear' command is now at your service at c:\programs\php-5.3.5-win32-vc6-x86\pear.bat

** The 'pear' command is not currently in your PATH, so you need to
** use 'c:\programs\php-5.3.5-win32-vc6-x86\pear.bat' until you have added
** 'C:\Programs\php-5.3.5-Win32-VC6-x86' 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!



* WINDOWS ENVIRONMENT VARIABLES *
For convenience, a REG file is available under C:\Programs\php-5.3.5-Win32-VC6-x86\PEAR_ENV.reg .
This file creates ENV variables for the current user.

Double-click this file to add it to the current user registry.

続行するには何かキーを押してください . . .

#### 何か失敗してる。Path to CLI php.exe だけは指定したほうがよかったか?
#### この内容は PEAR_ENV.reg にも反映されてるので、レジストリに登録する前に PHP_PEAR_PHP_BIN もフルパスに直しておく。
#### エラーが出ている通り、Structures_Graph が入らなくて PEAR がまともに動く状態にないので
#### Structures_Graph を手動でインストールする
#### http://pear.php.net/package/Structures_Graph/download からアーカイブをダウンロードして解凍、
#### Structures ディレクトリのみを C:\Programs\php-5.3.5-Win32-VC6-x86\PEAR にコピーして
> pear install -a Structures_Graph


#### PEARをアップグレードする
> pear upgrade PEAR

#### WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update
#### という警告が出るので

> pear channel-update pear.php.net

#### 多分これで PEAR は動くようになったんじゃない?