Install PEAR on macOS 10.15 Catalina

Prerequisites

  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 https://pear.php.net/install-pear-nozlib.phar
sudo php install-pear-nozlib.phar -d /usr/local/lib/php -b /usr/local/bin

Upgrade PEAR

sudo pear channel-update pear.php.net
sudo pecl channel-update pecl.php.net
sudo pear upgrade-all --ignore-errors

Configure PHP

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

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

Update PEAR and PECL channels

After a fresh installation, channels need to be updated.

sudo pear channel-update pear.php.net
sudo pecl channel-update pecl.php.net

Done!

You can now use the PEAR and PECL.

Questions?

Please leave a comment below.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Raptor Kwok

Raptor Kwok

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