« PHP4とPHP5を共存 | トップページ | Eclipse で PHP PDT »

2008年5月 8日 (木)

PHP4.4.8でgo-pear.bat

PHP4.4.8でgo-pear.batやるとこうなった

----------
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 PEAR\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::

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:\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:/php/cli/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] :

Loading zlib: ok

Bootstrapping Installer...................
Bootstrapping PEAR.php............(local) ok
Bootstrapping Archive/Tar.php............(local) ok
Bootstrapping Console/Getopt.php............(local) ok

Extracting installer..................
Using local package: PEAR.............ok
Using local package: Structures_Graph....ok

Preparing installer..................

Warning: fopen(XML/RPC.php): failed to open stream: No such file or directory in
C:\php\temp\PEAR\Remote.php on line 187
For this remote PEAR operation you need to load the xmlrpc extension or install
XML_RPC
続行するには何かキーを押してください . . .
----------

xmlrpcのextensionをONにしたりしたが先が続かん

http://www.phppro.jp/news/403
みんなPHP5に移行するのか、ぐぐっても解決みえず
もう動かないのだろうと判断しPHP5で動いたPEARをPHP4にコピーすることにした

c:\php\php (PHP4と共存するため通常(c:\php)とパスをかえている)
php-5.2.6-Win32をコピー

c:\php\php\PEAR\go-pear.phar

http://pear.php.net/go-pear.phar
の差分をWinMergeで比較したら同じだよ

c:\php\phpにPATH通して

php.ini-recommendedをコピーしてphp.ini作成


go-pear.bat
をダブルクリック

途中でallを選択してPEARの場所をかえた
----------

Are you installing a system-wide PEAR or a local copy?
(system|local) [system] : local
Please confirm local copy by typing 'yes' : yes

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

1-12, 'all' or Enter to continue: all
Installation base ($prefix) [C:\php\php] : C:\php
Temporary directory for processing [$prefix\tmp] :
Temporary directory for downloads [$prefix\tmp] :
Binaries directory [$prefix] :
PHP code directory ($php_dir) [$prefix\pear] :
Documentation directory [$prefix\docs] :
Data directory [$prefix\data] :
User-modifiable configuration files directory [$prefix\cfg] :
Public Web Files directory [$prefix\www] :
Tests directory [$prefix\tests] :
Name of configuration file [$prefix\pear.ini] :
Path to CLI php.exe [C:\php\php] :

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

1-12, 'all' or Enter to continue:
Beginning install...
Configuration written to C:\php\pear.ini...
Initialized registry...
Preparing to install...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3.2.tar...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.2.3.tar...

installing phar://go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.7.1.tar...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.2.tar.
..
pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)
install ok: channel://pear.php.net/Archive_Tar-1.3.2
install ok: channel://pear.php.net/Console_Getopt-1.2.3
install ok: channel://pear.php.net/Structures_Graph-1.0.2
install ok: channel://pear.php.net/PEAR-1.7.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"

******************************************************************************
WARNING!  The include_path defined in the currently used php.ini does not
contain the PEAR PHP directory you just specified:
<C:\php\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.

Would you like to alter php.ini <C:\php\php\php.ini>? [Y/n] : Y

php.ini <C:\php\php\php.ini> include_path updated.

Current include path           : .;C:\php5\pear
Configured directory           : C:\php\pear
Currently used php.ini (guess) : C:\php\php\php.ini
Press Enter to continue:

** WARNING! Old version found at C:\php, please remove it or be sure to use the
new c:\php\pear.bat command

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

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

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

'C:\php' にPATH通せといっているから通して動作確認pear list

INSTALLED PACKAGES, CHANNEL PEAR.PHP.NET:
=========================================
PACKAGE          VERSION STATE
Archive_Tar      1.3.2   stable
Console_Getopt   1.2.3   stable
PEAR             1.7.1   stable
Structures_Graph 1.0.2   stable


そんではPHP4から起動してみましょ
c:\php\php

c:\php\php-5.2.6-Win32にリネーム

php-4.4.8-Win32
をダウンロード
してc:\php\phpにコピー

php.ini-recommendedをコピーしてphp.ini作成して
include_path=".;C:\php\pear"
を追加

dllsとsapiのした全部を上の階層のc:\php\phpに移動
Apache Lounge

http://www.apachelounge.com/download/mods/php4apache2.dll-php4.4.x.zip

php4apache2.dll-php4.4.x.zip
をゲットして
c:\php\php\php4apache2.dll
を上書き

php --versionで

PHP 4.4.8 (cgi-fcgi) (built: Feb 12 2008 05:02:34)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

pear listで

INSTALLED PACKAGES, CHANNEL PEAR.PHP.NET:
=========================================
PACKAGE          VERSION STATE
Archive_Tar      1.3.2   stable
Console_Getopt   1.2.3   stable
PEAR             1.7.1   stable
Structures_Graph 1.0.2   stable

ついでに

pear install Pear_Info

WARNING: channel "pear.php.net" has updated its protocols, use "channel-update p
ear.php.net" to update
Did not download optional dependencies: channel://pear.phpunit.de/PHPUnit, use -
-alldeps to download automatically
pear/PEAR_Info can optionally use package "channel://pear.phpunit.de/PHPUnit" (v
ersion >= 3.1.4)
downloading PEAR_Info-1.8.0.tgz ...
Starting to download PEAR_Info-1.8.0.tgz (58,096 bytes)
..............done: 58,096 bytes
downloading Console_Getargs-1.3.4.tgz ...
Starting to download Console_Getargs-1.3.4.tgz (17,796 bytes)
...done: 17,796 bytes
install ok: channel://pear.php.net/Console_Getargs-1.3.4
install ok: channel://pear.php.net/PEAR_Info-1.8.0

まさごさんのサンプルより
<?PHP
require_once("PEAR/Info.php");
$info = new PEAR_Info();
$info->show();
?>

PHP4用のhttpd.confに下記追加
----------
#LoadModule php5_module c:/php/php/php5apache2_2.dll
LoadModule php4_module c:/php/php/php4apache2.dll
PHPIniDir c:/php/php
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
----------

Apache再起動で

PEAR configuration files "C:\WINDOWS\pear.ini", "C:\WINDOWS\pearsys.ini" does not exist

C:\php\pear.iniをC:\Windowsにコピーしまして
みえますがな

そういえば
PEAR_ENV.reg
はできなかったけどなんでだろ
すでにレジストリにあるとできないのかな

HKEY_CURRENT_USER\Environment
を丸ごと削除
念のためPC再起動で
PEAR_Infoアンインストールして見えなくなって再インストールでみえます

レジストリは必須ではなくて、pear.iniがあればいいのかな

PHP5と共存を考えなかったら
PHP5でデフォルト設定でPEARインストールしてPHP5のphp.exeとか削除して
pear.batを編集とかしてPHP4からPEARの場所を見えるようにするとかやるんかいな
まあ、動いたしPHP5と共存もできたし

最後にPHP5でPEAR動作チェック
php4とphp5を共存のバッチファイルでPHP5に切り替えてPear_Info表示OK

そっこうねよ

|

« PHP4とPHP5を共存 | トップページ | Eclipse で PHP PDT »

PHP」カテゴリの記事

パソコン・インターネット」カテゴリの記事

コメント

コメントを書く



(ウェブ上には掲載しません)




トラックバック

この記事のトラックバックURL:
http://app.f.cocolog-nifty.com/t/trackback/1009744/20801139

この記事へのトラックバック一覧です: PHP4.4.8でgo-pear.bat:

« PHP4とPHP5を共存 | トップページ | Eclipse で PHP PDT »