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:xamppphp’. Yours might be in ‘C:xampp-litephp’ 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%System32Wbem

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

;C:xamppphp

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:

[code lang=“dos”]pear install MDB2[/code]

Here’s how the execution look like:

Pear install for mdb2

[code lang=“dos”]C:UsersKahWee>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”[/code]

Now we can proceed to install the MySQL driver for MDB2:

[code lang=“dos”]pear install MDB2#mysql[/code]

To install MySQLi driver for MDB2:

[code lang=“dos”]pear install MDB2#mysql[/code]

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

[code lang=“dos”]C:UsersKahWee>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[/code]

[ad#highlight]

That’s all

You can install other modules in a similar way. To get a list of PEAR commands that you can use:

[code lang=“dos”]pear help[/code]

Hope it works well for you.

comments powered by Disqus