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

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

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.