How to install gmagick under OSX with phpbrew?

135 Views Asked by At

I tried to install gmagick PHP extension in a regular for PHPBrew way with: phpbrew ext install gmagick.

But it kept failing, even though gmagick itself is already installed in my system with: brew install gmagick.

Then I found out that PHPBrew is capable of installing beta versions of the software, so the next command was: phpbrew ext install gmagick beta.

And it almost succeeded... but the last error said "GraphicsMagic-config" is missing from the system. But it is not! When I run which GraphicsMagick-config, the location is correct (somewhere under brew cellar dir).

So, how do I point the ext installer to the correct location of the binary?

1

There are 1 best solutions below

0
On

Most likely, brew has added the executable gmagick binaries to the PATH for your shell, but it's not the same for the extension builder. So it misses the executables.

But there's a workaround:

sudo ln -s $(which GraphicsMagick-config) /usr/local/bin/GraphicsMagick-config.

We basically link the the existing executables from the brew location to the system's primary one. And then the build works like a charm:

phpbrew ext install gmagick beta.

Notice for the future users: I use beta suffix only due to the fact that gmagick 2 is still being developed and not released yet. May be not valid soon.