MacOS 自带php环境安装imagick扩展

本文档介绍了如何在MacOS上安装PHP的imagick扩展。首先,通过wget下载imagick扩展的tgz文件,然后使用tar进行解压。接着,进入解压后的目录,运行phpize生成configure,再配置并编译安装。在安装过程中可能会遇到autoconf缺失的问题,需要通过brew安装m4和autoconf。另外,由于macOS的Rootless特性,`make install`可能会失败,此时可以选择禁用Rootless或修改php.ini中的扩展目录,手动复制imagick.so到相应位置。
摘要由CSDN通过智能技术生成

安装php扩展imagick
下载:wget https://pecl.php.net/get/imagick-3.4.3.tgz

解压:sudo tar -zxvf imagick-3.4.3

安装:
cd imagick-3.4.3
sudo /usr/bin/phpize    <--- 生成configure
sudo ./configure --with-php-config=/usr/bin/php-config --with-imagick=/usr/local/ImageMagick
sudo make
sudo make install
3、在php.ini中添加imagick扩展
参考踩坑记录2.

踩坑记录
1、未安装m4 和autoconf工具,会报错如下:

$ sudo /usr/bin/phpize
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
解决办法:当然是安装m4、autoconf工具,推荐使用brew安装,这个网上教程很多,你当然会的啊。
brew install m4
brew install aut

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值