

Install PHP’s imagick extension on Mac with Brew
source link: https://ma.ttias.be/install-phps-imagick-extension-on-mac-with-brew/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Install PHP’s imagick extension on Mac with Brew
Mattias Geniar, October 16, 2019
Follow me on Twitter as @mattiasgeniar
I was setting up a new Mac and ran into this problem again, where a default PHP installation with brew
is missing a few important extensions. In this case, I wanted to get the imagick
extension loaded.
This guide assumes you have Homebrew installed and you’ve installed PHP with brew install php
.
Install Image Magick dependency
First, install imagemagick
itself. This is needed to get the source files you’ll use later to compile the PHP extension with.
$ brew install pkg-config imagemagick
This will also install the needed pkg-install
dependency.
Compile Imagick PHP extension with pecl
Next up, use pecl
to get the PHP extension compiled.
$ pecl install imagick [...] install ok: channel://pecl.php.net/imagick-3.4.4 Extension imagick enabled in php.ini
It will also auto-register itself in your php.ini and should now be available.
$ php -m | grep -i magic imagick
Note: if you run php-fpm, make sure you to restart your daemon to load the latest extension. Use brew services restart php
.
Permission denied errors?
You may get failed to open stream: Permission denied
errors when trying to perform a pecl
install. It shouldn’t happen, because Homebrew by default installs everything in local folders, but in case you do get that error you can prefix the commands with sudo
like this.
$ sudo pecl install imagick
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.
Recommend
-
18
How to Crop Images with PHP GD and Imagick Submitted by NanoDano on Mon, 07/27/2015 - 17...
-
11
Freek Van der Herten's blog on PHP, Laravel and JavaScriptScout APM is PHP application performance monitoring designed for developers. With tracing logic that ties issues back to the line of code causing th...
-
19
Jitwxs 搜索Mac 安装 brewJitwxs|发表于2020-09-26|更新于2020-12-19|
-
5
Oh noes, imagick doesn’t work!Permalink That’s what I thought, pretty much, as I...
-
1
Imagick previousImage() Function Related Articles Improve Article PHP | Imagick previousImage() FunctionLast Updated : 04 Dec, 2019The
-
11
简介 Homebrew 是一款自由及开放源代码的软件包管理系统,用以简化 macOS 和 linux 系统上的软件安装过程。它拥有安装、卸载、更新、查看、搜索等很多实用的功能,通过简单的一条指令,就可以实现包管理,十分方便快捷。 Homebrew
-
5
Mac OS安装brew 并更改brew源为国内源更新日期: 2022-06-22阅读量: 20标签:
-
3
如何解决WordPress ”可选的模组imagick未被安装或已被禁用” 解决 WordPress 5.x 站点健康( Site Health )检查提示"可选的模组imagick未被安装或已被禁用"问...
-
7
Brew install Redis on Mac · GitHub Instantly share code, notes, and snippets. Brew install Redis on Mac ...
-
5
首页技术宅LinuxRHEL / CentOS 系统安装 ImageMagick , PHP安装Imagick扩展...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK