Mac pecl install: configure: error: Please reinstall the pkg-config distribution

Tired of the privacy invasion of browsers? Worried about the risk of seeing ads everywhere? Give the Brave Browser a try. All Chrome extensions are compatible. None of the telemetry. Auto-blocks ads and still support content creators like me.

Download the Brave browser now »

Profile image of Mattias Geniar

Mattias Geniar, October 16, 2019

Follow me on Twitter as @mattiasgeniar

I ran into this error when doing a pecl install imagick on a Mac.

$ pecl install imagick
[...]
checking for pkg-config... no
pkg-config not found
configure: error: Please reinstall the pkg-config distribution
ERROR: `/private/tmp/pear/temp/imagick/configure --with-php-config=/usr/local/opt/php/bin/php-config --with-imagick' failed

By default, the needed pkg-config binary isn’t installed. You can install it via Homebrew.

$ brew instal pkg-config
==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.29.2.catalina.bottle.1.tar.gz
==> Downloading from https://akamai.bintray.com/c0/c0a6927c8e404f6db8b14d6644a218b22ddb0d27be1fa0a69d15bf0d9a6875ae?__gda__=exp=1571254410~hmac=2e306f9876b2de0ae458dcbf1e05bc609777305eb8ad5e25125e9467e8bfcfeb&response-content-disposition=
######################################################################## 100.0%
==> Pouring pkg-config-0.29.2.catalina.bottle.1.tar.gz
🍺  /usr/local/Cellar/pkg-config/0.29.2: 11 files, 623KB

And you’re all set!



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.