Install Pear in Wamp Server 2.2 (with php 5.3.8) for windows

First of all, install wamp 2.2 from Wamp server 2.2.


After that download pear from below.
DOWNLOAD PEAR


Then run following command in the command prompt.
C:\wamp\bin\php\php5.3.0>php go-pear.phar
Are you installing a system-wide PEAR or a local copy?
 (system|local) [system] : system
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 base ($prefix)                   : C:\wamp\bin\php\php5.3.0
 2. Temporary directory for processing            : C:\wamp\bin\php\php5.3.0\tmp
3. Temporary directory for downloads             : C:\wamp\bin\php\php5.3.0\tmp
4. Binaries directory                            : C:\wamp\bin\php\php5.3.0
 5. PHP code directory ($php_dir)                 : C:\wamp\bin\php\php5.3.0\pea
 r
 6. Documentation directory                       : C:\wamp\bin\php\php5.3.0\doc
 s
 7. Data directory                                : C:\wamp\bin\php\php5.3.0\dat
 a
 8. User-modifiable configuration files directory : C:\wamp\bin\php\php5.3.0\cfg
9. Public Web Files directory                    : C:\wamp\bin\php\php5.3.0\www
10. Tests directory                               : C:\wamp\bin\php\php5.3.0\tes
 ts
 11. Name of configuration file                    : C:\WINDOWS\pear.ini
 12. Path to CLI php.exe                           : C:\wamp\bin\php\php5.3.0
1-12, 'all' or Enter to continue:
 Beginning install...
 Configuration written to C:\WINDOWS\pear.ini...
 Initialized registry...
 Preparing to install...
 installing phar://C:/wamp/bin/php/php5.3.0/go-pear.phar/PEAR/go-pear-tarballs/Ar
 chive_Tar-1.3.7.tar...
 installing phar://C:/wamp/bin/php/php5.3.0/go-pear.phar/PEAR/go-pear-tarballs/Co
 nsole_Getopt-1.3.0.tar...
 installing phar://C:/wamp/bin/php/php5.3.0/go-pear.phar/PEAR/go-pear-tarballs/PE
 AR-1.9.4.tar...
 installing phar://C:/wamp/bin/php/php5.3.0/go-pear.phar/PEAR/go-pear-tarballs/St
 ructures_Graph-1.0.4.tar...
 installing phar://C:/wamp/bin/php/php5.3.0/go-pear.phar/PEAR/go-pear-tarballs/XM
 L_Util-1.2.1.tar...
 install ok: channel://pear.php.net/Archive_Tar-1.3.7
 install ok: channel://pear.php.net/Console_Getopt-1.3.0
 install ok: channel://pear.php.net/Structures_Graph-1.0.4
 install ok: channel://pear.php.net/XML_Util-1.2.1
 install ok: channel://pear.php.net/PEAR-1.9.4
 PEAR: Optional feature webinstaller available (PEAR's web-based installer)
 PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
 PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"
******************************************************************************
 WARNING!  The include_path defined in the currently used php.ini does not
 contain the PEAR PHP directory you just specified:
 
 If the specified directory is also not in the include_path used by
 your scripts, you will have problems getting any PEAR packages working.
Would you like to alter php.ini ? [Y/n] : y
php.ini  include_path updated.
Current include path           : .;C:\php5\pear
 Configured directory           : C:\wamp\bin\php\php5.3.0\pear
 Currently used php.ini (guess) : C:\wamp\bin\php\php5.3.0\php.ini
 Press Enter to continue:
** WARNING! Old version found at C:\wamp\bin\php\php5.3.0, please remove it or b
 e sure to use the new c:\wamp\bin\php\php5.3.0\pear.bat command
The 'pear' command is now at your service at c:\wamp\bin\php\php5.3.0\pear.bat
** The 'pear' command is not currently in your PATH, so you need to
 ** use 'c:\wamp\bin\php\php5.3.0\pear.bat' until you have added
 ** 'C:\wamp\bin\php\php5.3.0' to your PATH environment variable.
Run it without parameters to see the available actions, try 'pear list'
 to see what packages are installed, or 'pear help' for help.
For more information about PEAR, see:

http://pear.php.net/faq.php

http://pear.php.net/manual/

Thanks for using go-pear!
* WINDOWS ENVIRONMENT VARIABLES *
 For convenience, a REG file is available under C:\wamp\bin\php\php5.3.0PEAR_ENV.
 reg .
 This file creates ENV variables for the current user.
Double-click this file to add it to the current user registry.
C:\wamp\bin\php\php5.3.0>
At the end it will generate a .reg file, on which you have to double click to enter this information into registry.
Install again using C:\wamp\bin\php\php5.3.0>php go-pear.phar
The reason for installing 2 times the error will be removed which comes first time.

Wo, wo... wait. Still, the main part is remaining.

1. Open your php.ini file, which is located in C:\wamp\bin\php\php5.3.0
2. Find
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;; 


; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"

3. Add include_path = ".;C:\wamp\bin\php\php5.3.8\pear"


4. So now your file looks like.

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;


; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
include_path = ".;C:\wamp\bin\php\php5.3.8\pear"


5. Save file, repeat same for php.ini in apache server, located at 

C:\wamp\bin\apache\Apache2.2.21\bin

6. Restart php & apache.

Now enjoy pear.

For testing pear is installed well or not, go to command prompt, type pear, it will show you help of 'pear' command.

Popular posts from this blog

How to download Citrix XenApp 6 for free

Upload multiple files using AjaxFileUpload

4 reasons why I hate WhatsApp for iOS