XAMPP Pear Settings

XAMPP Pear.ini Settings

Contents

  1. XAMPP Pear.ini
    1. Contents
    2. Context
    3. Mandatory Gibberish
    4. Pearsys.ini
    5. Pear.ini
    6. pear config-show Output
    7. Registered Channels

Context

DATE /T
2012/01/29

XAMPP version
win32-1.7.7-VC9

PHP -v
PHP 5.3.8 (cli) (built: Aug 23 2011 11:50:20)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
    with Xdebug v2.1.2, Copyright (c) 2002-2011, by Derick Rethans

pear info pear
Release Date           2011-07-06 22:11:24
Release Version        1.9.4 (stable)
API Version            1.9.4 (stable)

Mandatory Gibberish

So, here's the deal. I dropped Zend Server and decided to go the "portable" route. Not that I think running a server from a flash drive is a great idea but, more that I like the idea of being able to. I put XAMPP on my hard drive and use Toucan to mirror files onto my flash drive. When I want to use PHP on a different computer I can either run it from the flash drive or use Toucan to mirror files from my flash drive to the other computer. This is a huge benefit. I can archive my development environment without any hassle at all.

After I got it all set up [download XAMPP, unzip to C:\, run xampp-control-3-beta.exe, click xampp shell] I wanted to install PHPUnit and several dozen other tools suggested or built by Mr. Sebastian Bergmann. There was one problem I ran into with XAMPP: PEAR didn't seem to have a configuration file but did have a whole mess of deprecated applications and extensions installed. I suppose tossing a fresh install of PEAR into XAMPP would clear out the old applications but it might break XAMPP as well so, I left them installed. What I did was look through the default settings for PEAR when I realized that it was creating C:\php\ by default and populating it with a few folders. Being that I want to keep the applications I install on the flash drive, I had to create Pear.ini and move some folders around. It would really suck to grab my flash drive, thinking that PHPUnit was safely stashed on it, only to realize that I'd left the program sitting on my hard drive at home!

To save you the trouble of having to type

pear config-show

and then

pear config-set

about 20 times, I'm posting my Pearsys.ini file. Copy it, drop it into

\xampp\php

and pear will use it as the system wide configuration file. If you change any settings then they'll be saved into Pear.ini by default and will override the settings in Pearsys.ini. Cool huh? Anyway, be sure to run

pear config-show

before you drop this ini file in place. You'll have to move the folders from where they're currently at to where the ini file says they'll be. If you haven't run pear yet, some of the folders won't exist. Don't worry about it, pear will create the folders when it needs them. For sure though, if you don't put the folders that do exist into their new position then your pear will be broken until you get it right.

For your convenience, the contents of Pearsys.ini configured for xampp-win32-1.7.7-VC9.7z. I've also given the contents of my Pear.ini file so you'll have some good channels available. I did set the preferred state to "beta" in Pear.ini, just so you're aware. Drop the two files into the same folder as pear.bat (\xampp\php) and move some folders around. You'll know when the ini files are in the right place when running config-show suddenly changes to show all the directories inside the xampp folder. You might want to run clear-cache, update-channels, upgrade pear, and update-channels before you install anything.

Pearsys.ini

#PEAR_Config 0.9
a:14:{s:7:"doc_dir";s:15:"\xampp\php\docs";s:10:"__channels";a:2:{s:12:"pecl.php.net";a:0:{}s:5:"__uri";a:0:{}}s:9:"cache_dir";s:25:"\xampp\php\tmp\pear\cache";s:7:"php_bin";s:18:"\xampp\php\php.exe";s:8:"temp_dir";s:20:"\xampp\tmp\pear\temp";s:8:"test_dir";s:16:"\xampp\php\tests";s:7:"www_dir";s:14:"\xampp\php\www";s:8:"data_dir";s:15:"\xampp\php\data";s:7:"cfg_dir";s:14:"\xampp\php\cfg";s:12:"download_dir";s:28:"\xampp\php\tmp\pear\download";s:7:"php_ini";s:18:"\xampp\php\php.ini";s:13:"auto_discover";i:1;s:7:"sig_bin";s:20:"\xampp\gnupg\gpg.exe";s:10:"sig_keydir";s:19:"\xampp\php\pearkeys";}

Pear.ini

#PEAR_Config 0.9

a:15:{s:7:"doc_dir";s:15:"\xampp\php\docs";s:10:"__channels";a:17:{s:12:"pecl.php.net";a:0:{}s:5:"__uri";a:0:{}s:16:"components.ez.no";a:0:{}s:11:"doc.php.net";a:0:{}s:15:"pear.phpunit.de";a:0:{}s:24:"pear.symfony-project.com";a:0:{}s:24:"pear.phpundercontrol.org";a:0:{}s:14:"pear.horde.org";a:0:{}s:28:"bartlett.laurent-laville.org";a:0:{}s:15:"pear.apigen.org";a:0:{}s:16:"pear.pdepend.org";a:0:{}s:14:"pear.phpmd.org";a:0:{}s:19:"pear.phpqatools.org";a:0:{}s:20:"pear.andrewsville.cz";a:0:{}s:16:"pear.kukulich.cz";a:0:{}s:14:"pear.nette.org";a:0:{}s:14:"pear.texy.info";a:0:{}}s:9:"cache_dir";s:25:"\xampp\php\tmp\pear\cache";s:7:"php_bin";s:18:"\xampp\php\php.exe";s:8:"temp_dir";s:20:"\xampp\tmp\pear\temp";s:8:"test_dir";s:16:"\xampp\php\tests";s:7:"www_dir";s:14:"\xampp\php\www";s:8:"data_dir";s:15:"\xampp\php\data";s:7:"cfg_dir";s:14:"\xampp\php\cfg";s:12:"download_dir";s:28:"\xampp\php\tmp\pear\download";s:7:"php_ini";s:18:"\xampp\php\php.ini";s:13:"auto_discover";i:1;s:7:"sig_bin";s:20:"\xampp\gnupg\gpg.exe";s:10:"sig_keydir";s:19:"\xampp\php\pearkeys";s:15:"preferred_state";s:4:"beta";}

pear config-show Output

When both ini files are in place this is what the settings for pear will show:

Administrator@DFOLDER C:\xampp
# pear config-show
CONFIGURATION (CHANNEL PEAR.PHP.NET):
=====================================
Auto-discover new Channels     auto_discover    1
Default Channel                default_channel  pear.php.net
HTTP Proxy Server Address      http_proxy       <not set>
PEAR server [DEPRECATED]       master_server    pear.php.net
Default Channel Mirror         preferred_mirror pear.php.net
Remote Configuration File      remote_config    <not set>
PEAR executables directory     bin_dir          \xampp\php
PEAR documentation directory   doc_dir          \xampp\php\docs
PHP extension directory        ext_dir          \xampp\php\ext
PEAR directory                 php_dir          \xampp\php\pear
PEAR Installer cache directory cache_dir        \xampp\php\tmp\pear\cache
PEAR configuration file        cfg_dir          \xampp\php\cfg
directory
PEAR data directory            data_dir         \xampp\php\data
PEAR Installer download        download_dir     \xampp\php\tmp\pear\download
directory
PHP CLI/CGI binary             php_bin          \xampp\php\php.exe
php.ini location               php_ini          \xampp\php\php.ini
--program-prefix passed to     php_prefix       <not set>
PHP's ./configure
--program-suffix passed to     php_suffix       <not set>
PHP's ./configure
PEAR Installer temp directory  temp_dir         \xampp\tmp\pear\temp
PEAR test directory            test_dir         \xampp\php\tests
PEAR www files directory       www_dir          \xampp\php\www
Cache TimeToLive               cache_ttl        3600
Preferred Package State        preferred_state  stable
Unix file mask                 umask            0
Debug Log Level                verbose          1
PEAR password (for             password         <not set>
maintainers)
Signature Handling Program     sig_bin          \xampp\gnupg\gpg.exe
Signature Key Directory        sig_keydir       \xampp\php\pearkeys
Signature Key Id               sig_keyid        <not set>
Package Signature Type         sig_type         gpg
PEAR username (for             username         <not set>
maintainers)
User Configuration File        Filename         C:\xampp\php\pear.ini
System Configuration File      Filename         C:\xampp\php\pearsys.ini

Registered Channels

Administrator@DFOLDER C:\xampp
# pear list-channels
REGISTERED CHANNELS:
====================
CHANNEL                      ALIAS        SUMMARY
bartlett.laurent-laville.org bartlett     Bartlett PEAR Channel
components.ez.no             ezc          eZ Enterprise components
doc.php.net                  phpdocs      PHP Documentation team
pear.andrewsville.cz         andrewsville Andrewsville PEAR channel
pear.apigen.org              apigen       ApiGen PEAR channel
pear.horde.org               horde        Horde PEAR server
pear.kukulich.cz             kukulich     Kukulich PEAR channel
pear.nette.org               nette        Nette PEAR channel
pear.pdepend.org             pdepend      PHP Depend PEAR channel
pear.php.net                 pear         PHP Extension and Application
                                          Repository
pear.phpmd.org               phpmd        PHP Mess Detector PEAR channel
pear.phpqatools.org          phpqatools   PEAR Channel for the PHP Quality
                                          Assurance Toolchain
pear.phpundercontrol.org     phpuc        phpUnderControl PEAR channel
pear.phpunit.de              phpunit      PHPUnit PEAR Channel
pear.symfony-project.com     symfony      The symfony project PEAR channel
pear.texy.info               texy         Texy PEAR channel
pecl.php.net                 pecl         PHP Extension Community Library
__uri                        __uri        Pseudo-channel for static packages