php - 错误: failed to mkdir/usr/include/php/ext/imagick

标签 php imagick

我尝试在 Mac 上安装 Imagick,但使用后出现此错误:

sudo pecl install imagick
ERROR: failed to mkdir /usr/include/php/ext/imagick

这是控制台日志:

downloading imagick-3.4.3.tgz ...
Starting to download imagick-3.4.3.tgz (245,410 bytes)
...................................................done: 245,410 bytes
19 source files, building
running: phpize
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
Please provide the prefix of Imagemagick installation [autodetect] :


如果我按回车键,那么它会继续加载很多东西,然后我收到错误:

Build process completed successfully
Installing '/usr/include/php/ext/imagick/php_imagick_shared.h'
ERROR: failed to mkdir /usr/include/php/ext/imagick

最佳答案

重新启动您的 Mac

按住 Cmd + R

打开终端

csrutil disable
reboot

运行

sudo pecl install imagick

添加

extension=/usr/lib/php/extensions/no-debug-non-zts-XXXXXX/imagick.so

安装完成后到你的 php.ini

重启你的Mac 按住 Cmd + R

打开终端

csrutil enable
reboot

关于php - 错误: failed to mkdir/usr/include/php/ext/imagick,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51253848/

相关文章:

php - 换行符不适用于 Wordpress TinyMCE Advanced

php - 使用 PHP GD 缩小动画 GIF

php - Laravel 密码重置 翻译

php - 如何根据图片调整水印?

php - 检查用户是否在页面上

php - 将日期从荷兰语转换为英语

php - Imagick 3 writeImages() 函数不工作

php - 导出具有高质量图像的 Canvas 的最佳做法是什么?

php - 加快 PHP Imagick 库 PDF -> PNG 转换(20 秒!)

php - VSCode 的电话中未定义类型 'Imagick'