Install PEAR on macOS 10.15 Catalina

Raptor Kwok
1 min readSep 9, 2020

macOS now no longer ships with PEAR, but installation is quite easy.


  1. Homebrew (install instructions)
  2. autoconf: use command: brew install autoconf
  3. Xcode command-line tools: xcode-select --install

Install PEAR

cd /tmp
curl -s -O
sudo php install-pear-nozlib.phar -d /usr/local/lib/php -b /usr/local/bin

Upgrade PEAR

sudo pear channel-update
sudo pecl channel-update
sudo pear upgrade-all --ignore-errors

Configure PHP

First, you have to find out which php.ini you’re using.

php --ini

Find the “Loaded Configuration File:” line. If no php.ini file is loaded, you can create one at /etc/php.ini with the following contents:

include_path = ".:/usr/local/lib/php/pear"

You can double confirm the newly created php.ini is loaded by issuing the second last command.

Update PEAR and PECL channels

After a fresh installation, channels need to be updated.

sudo pear channel-update
sudo pecl channel-update


You can now use the PEAR and PECL.


Please leave a comment below.



Raptor Kwok

I write stuffs: novels, programs, mobile apps, journal papers, book chapters, etc.