I am trying to install ImageMagick and Imagick locally on my Mac (using homebrew, apache and php 7.0). I have read some other questions, and tutorials online. Unfortunately many are years old and none work. These are the commands I ran:
brew install imagemagick # Success
brew install imagick # Not found, so i'll try something else
brew install php70-imagick # Still not found. read that need to install with "pecl"
pecl install imagick # Error: No releases available for package "pecl.php.net/imagick
# Read to manually download package to desktop and install with "pear"
pear install ~/Downloads/imagick-3.4.4.tgz # Cannot install, php_dir for channel "pecl.php.net" is not writeable by the current user
sudo pear install ~/Downloads/imagick-3.4.4.tgz # It runs and asks for prefix of ImageMagick installation, I chose 'autodetect'
It runs for a while, and then dies with:
In file included from /private/var/tmp/pear/temp/imagick/imagick_file.c:21:
/private/var/tmp/pear/temp/imagick/php_imagick.h:42:10: fatal error: 'php.h' file not found
#include "php.h"
^~~~~~~
1 error generated.
make: *** [imagick_file.lo] Error 1
ERROR: `make' failed
Any help is appreciated.
=== Edit ===
Here is the brew config:
$ brew config
HOMEBREW_VERSION: 2.2.10
ORIGIN: https://github.com/Homebrew/brew
HEAD: 48a1637b24a0c329905a981f4cff547c7fa47943
Last commit: 2 weeks ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 76ce3984f71e655b4f6d228351466ae610c867a5
Core tap last commit: 4 days ago
HOMEBREW_PREFIX: /usr/local
CPU: quad-core 64-bit broadwell
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1100
Git: 2.21.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.8.0_121
macOS: 10.15.3-x86_64
CLT: 11.0.33.17
Xcode: 11.3.1