Installing PEAR, MDB2 for WAMP server in Windows 7, Vista, XP 32 & 64 bit

Recently we had to install PEAR PHP library in WAMP (Windows, Apache, PHP, MySQL) environment. Trying to search www.wampserver.com website brought to our attention a lot of issues when people were trying to install it, also most of those how to guides and forum posts were quite outdated (2005/2006).
The following easy-to-follow tutorial has been practically tested with WAMP server (PHP version 5.2.10) in Windows 7 64 bit, besides this will work the same way in Windows Vista and XP, both 32 and 64 bit as well.
Prerequisites
This tutorial assumes that you have already:
- installed WAMP server and have it functioning.
If you need to install WAMP server in your Windows PC – please download and install the latest version of WAMP server. At the time of publishing this post - the latest version of WAMP server was 2.0i with PHP 5.3.0. - install PHP version 5.2.9 as an add-on. This is required due to PEAR installation errors with PHP 5.3.0 or above. To install this add-on you need to have latest WAMP server installed, up and running. Installation package available at wamp server add-ons page
- Test your WAMP installation and make sure PHP version is below 5.3.0.
You may test it by
1. opening your favourite browser and
2. typing in the following URL: http://localhost
3. the page at http://localhost should look like screenshot below:
Installation
- Run DOS shell.
- In Vista/Windows 7 click start button and type in cmd in the search box, then hit Enter key.
- In XP – click Start button, then click Run and type in cmd in text field, then click Ok button. - Navigate to PHP installation folder:
cd C:\wamp\bin\php\php5.2.9-2
the path here is php5.2.9-2 which may differ depending on PHP add-on version you have installed. - Make sure you are connected to the Internet. The next step will download PEAR to your computer.
- Run the following command
php.exe –r “readfile(‘http://pear.php.net/go-pear’);” > PEAR\go-pear
and wait until you see command prompt like in the screenshot above. This may take a while depending on your Internet connection speed. - Run go-pear file that just have been downloaded
php.exe PEAR\go-pear
![clip_image002[7] clip_image002[7]](http://www.truecms.net.au/sites/default/fck/InstallingPEARforWAMPserverinWindows7Vis_A237/clip_image0027_thumb.jpg)
- Next prompt – hit Enter key
![clip_image002[9] clip_image002[9]](http://www.truecms.net.au/sites/default/fck/InstallingPEARforWAMPserverinWindows7Vis_A237/clip_image0029_thumb.jpg)
- Next prompt – hit Enter key
![clip_image002[12] clip_image002[12]](http://www.truecms.net.au/sites/default/fck/InstallingPEARforWAMPserverinWindows7Vis_A237/clip_image00212_thumb.jpg)
- Make sure the next screen looks like this and you do not have empty paths
Especially important here in p.8 with php.exe path specified. This should not be empty. - Now it will ask you for few more packages (that are required to be installed for PEAR to function) to be downloaded and installed. Type in
Y
for Yes
![clip_image002[16] clip_image002[16]](http://www.truecms.net.au/sites/default/fck/InstallingPEARforWAMPserverinWindows7Vis_A237/clip_image00216_thumb.jpg)
- Watch how installer downloads packages and installs them. Do not interrupt the installer and look for possible error messages during the installation process and at the end of it.
This process can take few minutes. You may want to make yourself a cup of coffee or tea.
-
Test how PEAR works. This is system-wide (global) installation, so pear now becomes part of your Windows shell prompt
pear update-channels
This command should return output like below. If it says that pear is not internal command – then your PEAR installation failed.
![clip_image002[28] clip_image002[28]](http://www.truecms.net.au/sites/default/fck/InstallingPEARforWAMPserverinWindows7Vis_A237/clip_image00228_thumb.jpg)
-
Post your question or problems here

Comments
I have a problem with PEAR Structures DataGrid
Now matter what version of PHP I install on WAMP Server I cannot get the code to work when using the Structures Datagrid. I can get PEAR to work for everything else but I always get this message when it comes to the structures datagrid:
Unknown DataSource driver. Please specify an existing driver.Unknown Renderer driver. Please specify an existing driver.
Do you know why this is the case?
Not from the top of my head.
Not from the top of my head. Do you use system-wide PEAR installation or local? Becides I don't think this is PEAR or PHP version issue. It more sounds like your configuration settings. If you find solution - please post it here.
Win XP
Great Tutorial you are the man.
Although I (Win XP) had to manually download the go-pear file instead of using this command:
php.exe –r “readfile(‘http://pear.php.net/go-pear’);” > PEAR\go-pear
thanks math1as
Step #8
Here's what I get:
C:\wamp\bin\php\php5.2.9-2>php PEAR\go-pear
Welcome to go-pear!
Go-pear will install the 'pear' command and all the files needed by
it. This command is your tool for PEAR installation and maintenance.
Use 'php PEAR\go-pear local' to install a local copy of PEAR.
Go-pear also lets you download and install the following optional PEAR
packages: PEAR_Frontend_Web-beta, PEAR_Frontend_Gtk2, MDB2.
If you wish to abort, press Control-C now, or press Enter to continue:
HTTP proxy (http://user:password@proxy.myhost.com:port), or Enter for none::
Below is a suggested file layout for your new PEAR installation. To
change individual locations, type the number in front of the
directory. Type 'all' to change all of them or simply press Enter to
accept these locations.
1. Installation prefix ($prefix) : C:\wamp\bin\php\php5.2.9-2
2. Temporary files directory : $prefix\temp
3. Binaries directory : $prefix
4. PHP code directory ($php_dir) : $prefix\pear
5. Documentation base directory : $php_dir\docs
6. Data base directory : $php_dir\data
7. Tests base directory : $php_dir\tests
8. php.exe path : C:\wamp\bin\php\php5.2.9-2\php.exe
1-8, 'all' or Enter to continue:
The following PEAR packages are bundled with PHP: PEAR_Frontend_Web-beta,
PEAR_Frontend_Gtk2, MDB2.
Would you like to install these as well? [Y/n] : y
Loading zlib: ok
Bootstrapping Installer...................
Bootstrapping PEAR.php............(remote) ok
Bootstrapping Archive/Tar.php............(remote) ok
Bootstrapping Console/Getopt.php............(remote) ok
Extracting installer..................
Downloading package: PEAR.............ok
Downloading package: Structures_Graph....ok
Preparing installer..................
PEAR_Config::writeConfigFile fopen('C:\Windows\pear.ini','w') failed (fopen(C:\W
indows\pear.ini): failed to open stream: Permission denied)
C:\wamp\bin\php\php5.2.9-2>
Not sure why this happens.
Not sure why this happens. What version of Windows you use? Also you should be logged in as a user with administrative privileges - not limited user.
If you solved this - please post update.
No matter what I do, I can't
No matter what I do, I can't find Mail.php for pear, and all my scripts require it. My install worked fine, no errors. I'm lost at this point. I searched every directory for it, to no avail.
It Works!!!, Thank you very
It Works!!!, Thank you very much. I'm using PHP 5.2.11. :)
Dude, you just made my day if
Dude, you just made my day if i can figure out the rest:P
Thanks for the manual!
thank you!!! it works fine!
thank you!!! it works fine! :D
greetings from Chile!
thank a lot!
thank a lot!
Thanks mate exactly what I
Thanks mate exactly what I was looking for, worked like a charm!
I tried installing as you
I tried installing as you said here, but I keep only getting 5.3.0 on the list and even if I try to use the add on, I cannot find the menu you are describing here for me to switch back and forth as you described in step 1 and 2. Have I done anything wrong here?
You need to refer back to the
You need to refer back to the top of the page to download and install 5.2.x version of PHP.
Once you do this - launch Wampserver. You will see it's icon in the Windows notification area (bottom right corner).
Click this icon - select PHP - and from there select version you need (5.2.x). Wait until Wampserver restarts and then check your version of PHP (check top of this page for how you can do this).
Thanks alot... :) For a
Thanks alot... :) For a newbie it is very useful :) Great Work!!!!
Thank you very much - that
Thank you very much - that was so easy!!!
Hi, When I try to run the
Hi,
When I try to run the command in cmd, I get 'access denied'. I opened cmd as administrator, no difference. Anyone got any idea what access rights I need to fix?
thanks alot... :) men you
thanks alot... :) men you dont know but you help me..
i get the following error,
i get the following error, could anybody help me?
C:\wamp\bin\php\php5.2.9>php.exe PEAR\go-pear
Parse error: parse error in Command line code on line 1
Try to start from the
Try to start from the beginning. Something went wrong. Carefully check for any error messages.
Post new comment