How to install PEAR modules using XAMPP
This guide aims to go through installation of PEAR modules using XAMPP. The module to install is MDB2.
I use XAMPP Lite instead of the full XAMPP but I imagine it to be the similar. My platform is Windows Vista.
0. Objective
To install PEAR module, MDB2, using a XAMPP set up. Also install the MySQL, MySQLi and PostgreSQL drivers.
1. Setting up environment variables
Firstly, we would need to let the command prompt know where to find pear.bat. In my computer set up, it is located in ‘C:\xampp\php\’. Yours might be in ‘C:\xampp-lite\php\’ depending on where you install your XAMPP.
We need to edit some system environment variables:

Click on ‘Edit the system environment variables’, a dialog box will pop up. Click on ‘Environment Variables…’, you should be greeted with the following dialog box:

My path looks like this before I add anything:
Append your XAMPP PHP directory at the back of what is already there:
2. Install MDB2
Now that we have specified the environment variables, the command prompt knows where to find pear.bat. We can now execute the following:
Here’s how the execution look like:

downloading MDB2-2.4.1.tgz …
Starting to download MDB2-2.4.1.tgz (119,790 bytes)
……………………..done: 119,790 bytes
install ok: channel://pear.php.net/MDB2-2.4.1
MDB2: Optional feature fbsql available (Frontbase SQL driver for MDB2)
MDB2: Optional feature ibase available (Interbase/Firebird driver for MDB2)
MDB2: Optional feature mysql available (MySQL driver for MDB2)
MDB2: Optional feature mysqli available (MySQLi driver for MDB2)
MDB2: Optional feature mssql available (MS SQL Server driver for MDB2)
MDB2: Optional feature oci8 available (Oracle driver for MDB2)
MDB2: Optional feature pgsql available (PostgreSQL driver for MDB2)
MDB2: Optional feature querysim available (Querysim driver for MDB2)
MDB2: Optional feature sqlite available (SQLite2 driver for MDB2)
To install use "pear install MDB2#featurename"
Now we can proceed to install the MySQL driver for MDB2:
To install MySQLi driver for MDB2:
Since you already installed MDB2, the installer will just install the additional drivers like this:
Skipping package "pear/MDB2", already installed as version 2.4.1
downloading MDB2_Driver_pgsql-1.4.1.tgz …
Starting to download MDB2_Driver_pgsql-1.4.1.tgz (33,839 bytes)
………done: 33,839 bytes
install ok: channel://pear.php.net/MDB2_Driver_pgsql-1.4.1
That’s all
You can install other modules in a similar way. To get a list of PEAR commands that you can use:
Hope it works well for you.
Possibly related:
thanks….. I was searching for this for a long tim….
thnk u
Nov 13
Hi,
thanks a lot for this, its help me lot
Thanks
Dec 12
thats great … thanks
aneeshkumar
Aug 01
Thanks for your help. I will translate this in my site in turkish.
Aug 26
@zülküf: You’re welcome.
Aug 26
Sorry this just does not work.
Sep 25
Paul: What are you having problems with?
Sep 25
I’m running php 5.2.5 on windows XP and I get the same error for APC
(displayed below)
C:\php>pecl install apc
downloading APC-3.0.18.tgz …
Starting to download APC-3.0.18.tgz (115,957 bytes)
…………………….done: 115,957 bytes
47 source files, building
running: msdev APC.dsp /MAKE “APC – Release”
ERROR: Did not understand the completion status returned from
msdev.exe.
please help me.
Thanks
Oct 25
You might have to install Microsoft Visual Studio which comes with the msdev.exe That will help you install the package. Even i am facing the same problem and am waiting for a msdev installation. This process will essentially create a php_apc.dll which will run the APC module for you, also this dll gets placed under php\ext
You can try downloading the dll directly and placing it under the above mentioned folder.
try this url
http://docs.moodle.org/en/Installing_APC_in_Windows
Dec 30