Saturday, April 30, 2011

How to install or uninstall pear packages in xampp for windows


Recently I had some tough time installing pear packages in xampp so I am sharing procedure here so that it can help you.

First of all go to folder c:\xampp\php and find the file pear.bat. In my case I installed xampp in c drive. If its not in c drive go to the correct path and find pear.bat file.

Open that file in Notepad or Notepad++ to edit. Find the following line in in that file.


Add following line above this line.


Now include c:\xampp\php to PATH environment variable.

In windows vista you can find it here.

Start->Control Panel->System and Maintenance->System->Advanced System Settings->Environment Variable

That's it and now go to command prompt and type command pear. You will see all the possible options for that command.

Use following command to install pear package.

pear install -o 'path of package'

Use following command to uninstall pear package.

pear uninstall 'pearname'

Generally name of pear is directory name inside php/pears folder.

Hope this post saves your time.


  1. Hi, i tried doing the above procedure. When i ran this on the cmd prompt

    pear install -o Spreadsheet_Excel_writer

    what came out were these error messages:

    No release available for package ""
    Cannot initialize 'channel://', invalid or missing package file
    Package "channel://" is not valid
    install failed

    can u help out?
    Thanks in advance

  2. No need to go through these steps. You can simply install any pear package in Xaamp by doing the following steps.

    Go to the Xaamp control panel and click shell button. It will open a cmd window. Type pear install pear_package_name. (pear_package_name means name of your pear package you want to install).

    For example you can type pear install Net_GeoIP-1.0.0 to install Net_GeoIP pear package. But you need an active internet connection to do this. This also canbe done offline too if you already downloaded the package.

    1. Thanks for your comment. There are many ways to solve one problem. It depends on us which way we choose.

    2. I am getting an error
      # pear install
      PHP_PEAR_INSTALL_DIR is not set correctly.
      pearcmd.php could not be found there.
      Please fix it using your environment variable or modify
      the default value in pear.bat
      The current value is:
      plz help

  3. Thank you. It worked fine. This post indeed saved me time.


  4. Thank you SREEJITH it is working for me.


  5. This page helped me alot, thanks every body