• Archives

  • Categories

Oct 14

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:

Editing system environment variables in Windows Vista.

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:

Editing the path for environment variables

My path looks like this before I add anything:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem

Append your XAMPP PHP directory at the back of what is already there:

;C:\xampp\php\

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:

pear install MDB2

Here’s how the execution look like:

Pear install for mdb2

C:\Users\KahWee>pear install MDB2
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:

pear install MDB2#mysql

To install MySQLi driver for MDB2:

pear install MDB2#mysql

Since you already installed MDB2, the installer will just install the additional drivers like this:

C:\Users\KahWee>pear install MDB2#pgsql
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:

pear help

Hope it works well for you.

Possibly related:

  1. How to import and export MySQL database into an SQL file
  2. How to run XAMPP’s PHP CLI and CakePHP console
  3. How to install Python and Django in Windows Vista
  4. How to backup and restore in PostgreSQL

“How to install PEAR modules using XAMPP”
9 comments

  1. nikhil

    thanks….. I was searching for this for a long tim….
    thnk u

    Nov 13

  2. Sheetal Rakangor

    Hi,
    thanks a lot for this, its help me lot
    Thanks

    Dec 12

  3. aneeshkumar

    thats great … thanks

    aneeshkumar

    Aug 01

  4. Thanks for your help. I will translate this in my site in turkish.

    Aug 26

  5. @zülküf: You’re welcome. :D

    Aug 26

  6. Sorry this just does not work.

    Sep 25

  7. Paul: What are you having problems with?

    Sep 25

  8. 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

  9. shridhar

    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

Leave your comment.


WordPress powered and Django inspired.
Love and elephants come after.
RSS: Posts and comments.