This chapter describes how to install the PEAR package manager.

Introduction: it's simple (Previous) Introduction (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

Note by: michal @ glomesdal . com
Windows 7 will not allow the installation script to write to c:\windows\pear.ini. It gives the "Fatal error: Call to undefined method PEAR_Error::set()" error. Change the location of the configuration files (#11) to someplace writable, complete the installation, then copy the contents into c:\windows\pear.ini.

Thanks to helen@helengriffiths.me.uk for the initial hint about the pear.ini file.
Note by: sinthia@fireflowdesign.com
<p>Windows users - if you get an error like:
<pre>phar "C:\PHP\PEAR\go-pear.phar" does not have a signature</pre>
followed by an assortment of failed to open stream/non-existant file type of warnings and errors, the problem is with the package hash check. I was able to work around the problem like this:
<pre>php.exe -d phar.require_hash=0 go-pear.phar</pre>
(thanks to www.lenss.nl).</p>
<p>If anyone knows how to properly perform the hash check in the windows environment, I would love to know!

Note by: helen@helengriffiths.me.uk
If, after running go-pear.bat under Windows, you answer the file layout questions but then immediately see "Fatal error: Call to undefined method PEAR_Error::set() in phar://go-pear.phar/PEAR/Start.php on line xxx" where 'xxx' is a number, check the answers that you gave for the file layout.

In particular, check item 11, the name of the configuration file, because, unlike the other locations, it is not a directory but a file name and so needs to end in "pear.ini".
Note by: angry user
php go-pear-phar doesn't work in Windows if there're spaces in the path! (i.e. C:\Program Files (x86)\PHP\v5.3\PEAR)

Why is it so difficult to install this??? Why don't just unzip something to a folder and manually edit the include_path on php.ini
Note by: stowaway.mike@gmail.com
Quoting:
"Effectively, you simply Start Menu -> Run -> CMD

c:\cd php
c:\php\go-pear.bat"

Too bad it's not that simple. Doing that, I got a number of warnings... "failed to open stream...", etc. It looks like the batch file is poorly written.

Pear might have potential, but it's still half-baked.
Note by: doconnor
Windows users should take a look at http://pear.php.net/manual/en/installation.getting.php

Effectively, you simply Start Menu -> Run -> CMD

c:\cd php
c:\php\go-pear.bat

The other instructions are really only suited for manual installation, and I would never, ever recommend them.
Note by: user@example.com
This page is completely useless! PHP does not come with any PEAR stuff installed by default on Windows.
Note by: K.A.R.R.
How to install and test easily on Windows this stupid thing, referring to PEAR-1.9.1.tgz!

There is a very intuitive guide at geeksengine.com: http://www.geeksengine.com/article/install-pear-on-windows.html.

That guide gives you what the instructions inside the .tgz file can't do.
Note by: ashnazg
If your PEAR installation is an old version (earlier than 1.4.0) that is provided by your operating system's package manager or your "website package" (e.g. XAMPP), then you need to read this [1] to successfully upgrade your PEAR installation to where it can install/upgrade packages from PEAR's pear.php.net channel.

[1] -- http://pear.php.net/news/package.xml.1.0.php
Note by: hm2k
You may also find this page useful:

http://pear.php.net/manual/en/guide.users.commandline.installing.php

(With regards to "Easy Install Not sure? Get more info.")