Install Pear on Windows 7 64x using WAMP

Installing PEAR on Windows 7 seems simple; however, a few headaches with some recent versions of PHP can leave some people confused. The go-pear.bat file doesn’t exist in some 64x downloads of WAMP and PHP. By following these steps to workaround this issue, you should be able to get Pear installed into your WAMP setup.

You must have WAMP installed correctly first.

1 We need to first locate the file go-pear.bat in our WAMP PHP install directory. In the current installation, this is located at C:\wamp\php\php5.3.13 although this will change based on your current version. In WAMP 64-bit versions sometimes this file is not included. Instead we can use the file go-pear.phar instead. Visit http://pear.php.net/go-pear.phar in your browser and save the page to a local go-pear.phar file.

2 Put this file in the following directory:

C:\wamp\bin\php\php5.1.13

(This directory may be different depending on your version of PHP.)

3 Now, pull up the Windows start menu, type in CMD, then hit enter. We need to look at the folder we just put the .phar file in, so enter this string:

cd C:\wamp\bin\php\php5.3.13

and hit enter. We should now be looking in this directory.

PEAR CMD

4 Next, we will need to run this .phar file by using the following command:

php go-pear.phar

5 It will ask “Are you installing a system-wide PEAR or local copy?” You will need to type “local” and hit enter. It will ask you to confirm by typing “yes” and hitting enter.

Pear local

6 You will be shown the 12 file locations corresponding to where PEAR will install packages, documents, config files and more. I just leave these on default in my WAMP PHP folder. Press enter to bypass this and accept this.

7 You may receive the following error:

This is letting you know your php.ini file doesn’t have the path that you just specified above in the CMD. If you type a simple “Y” and hit enter, the php.ini file will automatically be updated. Go ahead and do this if needed.

8 You should be done with the CMD part now. If everything worked correctly, you should be notified that “The ‘pear’ command is now at your service…”

9 Next, we need to add pear’s path to make sure that installing packages work. Go to Windows and type in System and hit enter. Click on Advanced System Settings on the left, then under the Advanced tab click Environment Variables.

Edit the Path Variable and append the location to your PHP version folder in wamp:

C:\wamp\bin\php\php5.3.13;

Hit okay to save it. Be sure to include the semi-colon at the end of the folder path.

10 Now open back up our CMD and type in pear followed by enter. If everything is working correctly, you should see pear’s list of commands.

 

About Chris Luongo

Chris is a self-taught web designer and developer out of Atlanta, GA. This geek enjoys coffee, cold brews, bike riding, and twisting any form of tech into submission.
View more articles by Chris Luongo

The Conversation

Follow the reactions below and share your own thoughts.

5 Responses to “Install Pear on Windows 7 64x using WAMP”

  1. April 22, 2013 at 3:05 pm, Rubab Hfeez Khan said:

    thank u sooooooooooooooooooooooooo much

    Reply

  2. May 10, 2013 at 5:04 am, gs said:

    Thank you, this is the only thing that work!
    Do you have some advice about instaling phpDocumentor?
    I have problems with that to…when i try to instal in next way

    pear channel-discover pear.phpdoc.org
    pear install phpdoc/phpDocumentor-alpha

    i get

    ERROR: failder to mkdir C:\php\pear\data\phpDoocumentor\features\Parser

    btw i have wamp 2.2 in C:\wamp\www

    Reply

  3. May 22, 2013 at 5:49 pm, OldManRiver said:

    Hey this works, but in my case the 2 needed .dll files:

    php_phar.dll
    php_ssh2.dll

    Did not install and getting errors now on every command.

    Had to temp comment them out in the php.ini, since they can not be found, but need these as writing a ssh2_connect string right now!

    Cheers!

    OMR

    Reply

  4. June 18, 2013 at 2:17 am, luisdev said:

    in Step 5 you are asked: “Are you installing a system-wide PEAR or local copy?” What is the difference between a system-wide copy and a local copy? When should you select system and when should you select local?

    Reply

  5. March 02, 2014 at 9:14 am, Karsho said:

    Simply Thanks….

    Reply

Leave a Reply