4

I'm using PHP 5.5 installed through Macports. I'd like to add the APCu PECL library. But there's no macports package and I can't see a way to install the PEAR/PECL command line utility. So how does one add APCu (or really any PECL library) to PHP 5.5 installed via Macports?

Matt S
  • 402

3 Answers3

5

I was stumbling over how to get PEAR working on MacPorts as well. It turns out that I installed it somehow (possibly with the core PHP package, php54 with the default variants in my case…?), but MacPorts didn't put the binary in a normal $PATH location, so my shell couldn't find it. It was hanging out in /opt/local/lib/php/pear/bin/pear. A simple ln -s /opt/local/lib/php/pear/bin/pear /opt/local/bin/pear and a rehash (that bit might be a tcsh-ism), and I was in business.

1

From the mac terminal console, run:

$ port search pear | grep php54
php54-pear @20110901_4 (php, www)
Optional port adds the PEAR repository to the include path for php54.

There is a pear package for 5.4 now. You can then:

$ sudo port install php54-pear

And you should be in good shape.

TrippyD
  • 111
-3

You can try Homebrew instead, e.g.

brew install php56 --with-pear

Then pecl command should be already there, if not, link it again via:

brew unlink php56 && brew link php56 --dry-run && brew link php56

or manually:

ln -vs "$(find /usr/local/Cellar/php56 -name pecl -print -quit)" /usr/local/bin
kenorb
  • 26,615