How do I install imagemagick with homebrew?

前端 未结 5 806
失恋的感觉
失恋的感觉 2020-12-22 17:24

I\'m trying to install Imagemagick on OSX Lion but something is not working as expected.

-> brew install imagemagick

/usr/local/git/bin/git
==> Clonin         


        
相关标签:
5条回答
  • 2020-12-22 17:52

    Answering old thread here (and a bit off-topic) because it's what I found when I was searching how to install Image Magick on Mac OS to run on the local webserver. It's not enough to brew install Imagemagick. You have to also PECL install it so the PHP module is loaded.

    From this SO answer:

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

    And you may need to sudo apachectl restart. Then check your phpinfo() within a simple php script running on your web server.

    If it's still not there, you probably have an issue with running multiple versions of PHP on the same Mac (one through the command line, one through your web server). It's beyond the scope of this answer to resolve that issue, but there are some good options out there.

    0 讨论(0)
  • 2020-12-22 17:54

    You could try:

    brew update && brew install imagemagick

    0 讨论(0)
  • 2020-12-22 18:02

    The quickest fix for me was doing the following:

    cd /usr/local
    git reset --hard FETCH_HEAD
    

    Then I retried brew install imagemagick and it correctly pulled the package from the new mirror, instead of adamv.

    If that does not work, ensure that /Library/Caches/Homebrew does not contain any imagemagick files or folders. Delete them if it does.

    0 讨论(0)
  • 2020-12-22 18:06

    You could do:

    brew reinstall php55-imagick
    

    Where php55 is your PHP version.

    0 讨论(0)
  • 2020-12-22 18:17
    brew install imagemagick
    

    Don't forget to install also gs which is a dependency if you want to convert pdf to images for example :

    brew install ghostscript
    
    0 讨论(0)
提交回复
热议问题