Windows版PHPにPEARをインストールする
PEAR(PHP Extension and Application Repository)とはPHPの拡張ライブラリの1つです。
PerlでいえばCPAN(Comprehensive Perl Archive Network)、
TeXでいえばCTAN(Comprehensive TeX Archive Network)に該当します。
Linux版PHPには標準でPEARで組み込まれていますが、Windows版PHPでは通常組み込まれていないため、手動でインストールする必要があります。
公式サイト
日本語マニュアル
インストールの詳細
共有サーバでPEARの使用
パッケージマネージャのインストール
下記のURLより、PEARインストールのためのPHPのソースコードをダウンロードします。
http://pear.php.net/go-pear
これをgo-pear.phpとして保存します。
実行方法1
go-pear.phpをPHPのインストールフォルダに、PEARというフォルダを作って、そこに保存します。
また次のコードを、go-pear.batとして、PHPのインストールフォルダに保存し、実行します。
@ECHO OFF set PHP_BIN=php.exe %PHP_BIN% -d output_buffering=0 PEAR\go-pear.php pause
階層
PHPのインストールフォルダ(C:\Program Files\PHP または C:\PHP) ├ PEAR │└ go-pear.php └ go-pear.bat
実行方法2
go-pear.phpをPHPのインストールフォルダに保存します。
コマンドプロンプトより
C:\>cd C:\Program Files\PHP C:\Program Files\PHP>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. Use 'php go-pear.php local' to install a local copy of PEAR. 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:: *WARNING* We found php.exe under c:\program files\php\php.exe, it uses an unknown SAPI. PE AR commandline tool has not been tested with it, if you have a CLI (or CGI) php.exe available, we strongly 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 ($prefix) : C:\Program files\PHP 2. Temporary files directory : $prefix\temp 3. Binaries directory : $prefix 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 8. php.exe path : c:\program files\php\php.exe 1-8, '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 ……………… ……… Would you like to alter php.ini <C:\Program Files\PHP\php.ini>? [Y/n] : Y ……………… ………
PEARコマンド
| コマンド | 説明 |
|---|---|
| pear help | pearのヘルプを表示します |
| pear help [command] | pearコマンドのヘルプを表示します |
| prar list | ローカルにインストールされているPEARパッケージの一覧を表示します |
| pear remote-list | リモートからインストール可能なPEARパッケージの一覧を表示します |
| pear search [packagename] | リモートからインストール可能なパッケージを検索します |
| pear install [packagename] | パッケージをインストールします |
| pear install -a [packagename] | パッケージをインストールします ※依存しているパッケージも自動的にインストールします(-aオプション) |
スポンサーリンク
関連記事
- Apacheから2GB以上のファイルをダウンロードしようとすると403エラーが出ます
- 1枚のNIC(ネットワークカード)に複数のIPアドレスを設定する方法(Windows)
- WindowsのPCをルータにする方法(DHCP接続)
- memcachedのインストール
- Rubyのインストール
- PostgreSQLのインストール
- 他のパソコンからもApacheなどを閲覧できるようにする方法
- WindowsXP、Windows2000のジャンクション機能は危険
- Windows版ApacheでCGI(Perl)を使用する方法 ActivePerl
- Windowsでシンボリックリンクを使う方法
- JDKの常駐ソフトjusched.exeを停止する方法
- ほかのアプリケーションにポートを使用されてApacheが起動できない
- DNSの設定を端末で独自に設定するには
- Windows版PHPのインストール
- Windows Apacheのインストール
- Windows MySQLインストール後の設定
- Windows MySQLのインストール
- PHP
- Fatal error: Call to undefined function imagecreatefromjpeg() の対処法
- [暗号化]ブロック暗号とは(AES/DES/Blowfish PKCS5Padding ECB/CBC IV)
- Firefox、Chromeなどで文字化けを防ぐ方法 ヘッダー情報に文字コードを指定
- ダブルクオート/シングルクオート/ヒアドキュメント、echo/printの速度比較
- SSL通信かどうか
- Joomla(ジュームラ)
- Wordpress
- Live Commerceとは
- PHPをコマンドラインから使用する方法
- サイトを公開するときの設定
- Movable Type
- VGA端末用に出力画像を拡大縮小する方法
- CakePHP
スポンサーリンク






