— [php]XAMPPでPEARが使えないとき
Posted: Oct 28, 2008, 1:12 am | Author: cyberryo | Category: Dialy | Tags: PEAR, PHP, Xampp
XAMPPってインストールしただけじゃPEARが使えないって、昔からでしたっけ?久々にpear使おうと、コマンド打ってもFatal errorが出まくって大変でした。
エラーの内容は、
「Fatal error: require_once(): Failed opening required ‘PEAR.php’」
こんな感じだったり、
「Warning: require_once(PEAR.php): failed to open stream:」
こんなのだったり。
いわゆる、パスが通っていませんよと言われました。
でも何度php.iniのinclude_pathを確認しても、パスは通ってるし、、、先頭に付いてる「.;」みたいなものは関係ないし。。
なぞがなぞを呼ぶエラーと格闘すること数十分。
xamppを再インストールしてみました。
すると次はなんとpear.batがなくなってたww
でもこれがなくなったおかげで、気づきました。
「go-pear.bat」という大変親切なバッチがありましたよw
C:\xampp\php>go-pear Are you installing a system-wide PEAR or a local copy? (system|local) [system] : yes Please confirm local copy by typing 'yes' : yes Below is a suggested file layout for your new PEAR installat change individual locations, type the number in front of the directory. Type 'all' to change all of them or simply press accept these locations. 1. Installation base ($prefix) : C:\xampp 2. Temporary directory for processing : C:\xampp 3. Temporary directory for downloads : C:\xampp 4. Binaries directory : C:\xampp 5. PHP code directory ($php_dir) : C:\xampp 6. Documentation directory : C:\xampp 7. Data directory : C:\xampp 8. User-modifiable configuration files directory : C:\xampp 9. Public Web Files directory : C:\xampp 10. Tests directory : C:\xampp 11. Name of configuration file : C:\xampp 12. Path to CLI php.exe : C:\xampp 1-12, 'all' or Enter to continue: Beginning install... Configuration written to C:\xampp\php\pear.ini... Initialized registry... Preparing to install... installing phar://go-pear.phar/PEAR/go-pear-tarballs/Archive installing phar://go-pear.phar/PEAR/go-pear-tarballs/Console installing phar://go-pear.phar/PEAR/go-pear-tarballs/PEAR-1. installing phar://go-pear.phar/PEAR/go-pear-tarballs/Structu .. pear/PEAR can optionally use package "pear/XML_RPC" (version 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-ba PEAR: Optional feature gtkinstaller available (PEAR's PHP-GT PEAR: Optional feature gtk2installer available (PEAR's PHP-G PEAR: To install optional features use "pear install pear/PE ************************************************************ WARNING! The include_path defined in the currently used php contain the PEAR PHP directory you just specified: <c:\xampp\php\pear> If the specified directory is also not in the include_path u your scripts, you will have problems getting any PEAR packag Would you like to alter php.ini <c:\xampp\php\php.ini>? [Y/n php.ini <c:\xampp\php\php.ini> include_path updated. Current include path : .;C:\xampp\php\pear\ Configured directory : C:\xampp\php\pear Currently used php.ini (guess) : C:\xampp\php\php.ini Press Enter to continue: ** WARNING! Old version found at C:\xampp\php, please remove e the new c:\xampp\php\pear.bat command The 'pear' command is now at your service at c:\xampp\php\pe 続行するには何かキーを押してください . . .
これですべてが一件落着。
php.iniの設定も自動で書き込んでもらえるので、xamppインストール後にはとりあえずgo-pearした方がラクですね。