2013 年 : Pear インストール / Mail パッケージと実行サンプル( GMail でメール送信 )
Pear は、いったんダウンロードしてしまえば、それを別の環境に単純コピーでインストールする事ができます。それは、レンタルサーバでも同じでアップロードするだけで動作します。
ただ、いずれかのバージョンから go-pare.bat を実行する必要があるので、PHP のサイトより、5.2.17 をダウンロードし、c:\php5217 の中に php-cgi.exe がある環境を作り、そのフォルダ内をカレントとして go-pare.bat を実行しています。
http://pear.php.net/go-pear.phar をダウンロードして、php go-pear.phar と実行します
( PHP 5.2.17 VC6 x86 Non Thread Safe )
system か local の違いは、Windows のディレクトリに ini ファイルを作るかどうかですが、インストール元が欲しいだけなので、local を入力してやると、pear.ini がこのフォルダの中に作成されます。後は、Enter でインストールが開始されます。
警告が出ていますが、インストールは成功しているので Enter で続行します。
また、警告が出ていますが、インストールは成功しているので Enter で終了します。
pear.bat で、このままパッケージ処理をしようとすると、警告がでるので、こちらは対処方法がメッセージで表示されるので、その通りにチャネルの更新を行います。
pear channel-update pear.php.net
パッケージの正しい文字列は pear search File のように文字列の一部分から一覧を表示する事ができるので、パッケージ名を取得し、インストールします
( 例 : pear install -f -a -o File_Archive )
インストールのオプションは、pear help install で表示する事ができます
( -o はいらないと思いますが、一応念のためです )
-f, --force
will overwrite newer installed packages
-l, --loose
do not check for recommended dependency version
-n, --nodeps
ignore dependencies, install anyway
-r, --register-only
do not install files, only register the package as installed
-s, --soft
soft install, fail silently, or upgrade if already installed
-B, --nobuild
don't build C extensions
-Z, --nocompress
request uncompressed files when downloading
-R DIR, --installroot=DIR
root directory used when installing files
(ala PHP's INSTALL_ROOT), use packagingroot for RPM
-P DIR, --packagingroot=DIR
root directory used when packaging files, like RPM packaging
--ignore-errors
force install even if there were errors
-a, --alldeps
install all required and optional dependencies
-o, --onlyreqdeps
install all required dependencies
-O, --offline
do not attempt to download any urls or contact channels
-p, --pretend
Only list the packages that would be downloaded
※ インストールとは関係ありませんが、PHP 5.3 以降では
※ error_reporting(E_ALL & ~E_DEPRECATED); を実行しておかないと
※ 実行時に警告が出るライブラリがあります
▼
Deprecated: Assigning the return value of new by reference is deprecated
▼ 警告発生例( 5.3 以降でしか使わない場合は =& を = に変更しても良い )
$tmp =& new File_Archive_Reader_ChangeName_AddDirectory(
$realSymbolic,
$result
);