我试图在OSX Lion上安装Imagemagick,但有些东西没有像预期的那样工作。

-> brew install imagemagick

/usr/local/git/bin/git
==> Cloning https://github.com/adamv/ImageMagick.git
Cloning into /Users/klebershimabuku/Library/Caches/Homebrew/imagemagick--git...
fatal: https://github.com/adamv/ImageMagick.git/info/refs not found: did you run git      update-server-info on the server?
Error: Failure while executing: git clone --depth 1 https://github.com/adamv/ImageMagick.git /Users/kleber/Library/Caches/Homebrew/imagemagick--git

酿酒医生说:

-> brew doctor
We couldn't detect gcc 4.0.x. Some formulae require this compiler.

Some "config" scripts were found in your path, but not in system or Homebrew folders.

`./configure` scripts often look for *-config scripts to determine if software packagesare installed, and what additional flags to use when compiling and linking.

Having additional scripts in your path can confuse software installed via Homebrew if the config script overrides a system or Homebrew provided script of the same name.

/Users/kleber/.rvm/gems/ruby-1.9.2-p180@global/bin
passenger-config

Setting DYLD_LIBARY_PATH can break dynamic linking.
You should probably unset it.

是的,我已经安装和运行XCode 4.1。

-> brew update
From http://github.com/mxcl/homebrew
* branch            master     -> FETCH_HEAD
Already up-to-date.

当前回答

你可以这样做:

brew reinstall php55-imagick

php55是你的PHP版本。

其他回答

得到一个类似的错误,并通过运行brew更新在brew安装imagemagick修复

在这里回答旧的话题(有点跑题),因为这是我在搜索如何在Mac OS上安装Image Magick以在本地web服务器上运行时发现的。仅仅编写安装Imagemagick是不够的。您还必须PECL安装它,以便加载PHP模块。

从这个SO回答:

brew install php
brew install imagemagick
brew install pkg-config
pecl install imagick

并且您可能需要sudo apachectl restart。然后检查在web服务器上运行的简单php脚本中的phpinfo()。

如果仍然没有,你可能在同一台Mac上运行多个版本的PHP有问题(一个通过命令行,一个通过web服务器)。这超出了解决这个问题的范围,但有一些不错的选择。

brew install imagemagick

不要忘记安装gs,这是一个依赖,如果你想将pdf转换为图像,例如:

brew install ghostscript

你可以试试:

Brew更新&& Brew安装imagemagick

你可以这样做:

brew reinstall php55-imagick

php55是你的PHP版本。