php安装imagick扩展

简介:
+关注继续查看

需要下载的东西:

1
2
3
4
5
6
7
libwebp-0.5.1.tar.gz
wget 
  
ImageMagick6.9.5.tar.gz
wget http://git.imagemagick.org/repos/ImageMagick/repository/archive.tar.gz?ref=6.9.5-0
imagick-3.1.2.tgz
https://pecl.php.net/get/imagick-3.1.2.tgz

一定要用ImageMagick6.9.5.tar.gz这个包,因为官方最新版的是ImageMagick-7.0.2-4,安装后有问题.


一.

1
yum -y install libpng-devel libjpeg-devel

二.安装webo库

1
2
3
4
5
6
[root@testserver-1 src]# tar -zxvf libwebp-0.5.0.tar.gz
[root@testserver-1 src]# cd libwebp-0.5.0/
[root@testserver-1 libwebp-0.5.0]# ./configure && make && make install
[root@testserver-1 libwebp-0.5.0]# cp /usr/local/lib/libwebp.so.6.0.0 /usr/lib64/
[root@testserver-1 libwebp-0.5.0]# ln -s  /usr/lib64/libwebp.so.6.0.0 /usr/lib64/libwebp.so.6
[root@testserver-1 libwebp-0.5.0]# ln -s  /usr/lib64/libwebp.so.6.0.0 /usr/lib64/libwebp.so

安装ImageMagick

1
2
3
4
5
[root@testserver-1 src]# tar -zxvf ImageMagick6.9.5.tar.gz
[root@testserver-1 src]# cd ImageMagick-6.9.5/
[root@testserver-1 ImageMagick-6.9.5]# ./configure --prefix=/usr/local/imagemagick --with-webp
[root@testserver-1 ImageMagick-6.9.5]# make && make install
[root@testserver-1 src]# ln -s /usr/local/imagemagick/include/ImageMagick-6 /usr/local/imagemagick/include/ImageMagick

不同的地方:

1
2
3
4
[root@testserver-1 src]# vim /etc/profile
export MAGICK_HOME=/usr/local/imagemagick/
export PATH=$MAGICK_HOME/bin:$PATH
[root@testserver-1 src]# source /etc/profile

没有上面那一步,可能会找不到convert命令。

安装php扩展

1
2
3
4
5
tar -zxvf imagick-3.1.0RC2.tgz
cd imagick-3.1.0RC2/usr/local/php/bin/phpize
export PKG_CONFIG_PATH=/usr/local/imagemagick/lib/pkgconfig
./configure --with-php-config=/usr/local/php/bin/php-config --with-imagick=/usr/local/imagemagick
make && make install

有两个坑,就是用官方的最新版本ImageMagick,不正常.




本文转自 yawei555 51CTO博客,原文链接:http://blog.51cto.com/huwei555/1826692,如需转载请自行联系原作者

相关文章
|
6天前
|
Ubuntu PHP Windows
在安装PHP时出现了冲突请求的问题
在安装PHP时出现了冲突请求的问题
9 1
|
8天前
|
算法 PHP 数据安全/隐私保护
【实战】php goto解密工具,无需安装php环境,直接解密
php goto解密方法,php解密工具,goto解密,php微擎解密,代码可读性,代码可维护性
20 1
|
1月前
|
IDE NoSQL 关系型数据库
开发php,需要安装哪些工具
开发php,需要安装哪些工具
|
1月前
|
关系型数据库 MySQL PHP
PHP服务环境配置之 WampServer的安装与环境配置
PHP服务环境配置之 WampServer的安装与环境配置
|
1月前
|
监控 PHP
zabbix安装php依赖【全】
zabbix安装php依赖【全】
|
1月前
|
PHP
PHP的安装与配置
PHP的安装与配置
24 0
|
2月前
|
设计模式 IDE 程序员
PHP中安装和使用xdebug
作为一个程序员,千万不要说你没有用过debug工具,不然有点说不过去。xdebug是PHP语言一个强大的利器,用他可以做很多事情。
|
2月前
|
机器学习/深度学习 Linux 测试技术
Linux环境下面安装PHP性能分析工具XHProf(PHP5.6)
Linux环境下面安装PHP性能分析工具XHProf(PHP5.6)
|
2月前
|
Linux PHP
Linux环境下安装pecl工具,PHP扩展便捷安装
Linux环境下安装pecl工具,PHP扩展便捷安装
135 0
|
2月前
|
缓存 Linux PHP
PHP快速入门14-Composer包管理安装与使用,附常见的20个使用例子
PHP Composer 是 PHP 的一个包管理工具,它被广泛用于 PHP 应用程序的依赖管理。Composer 可以自动查找和下载 PHP 应用所需要的第三方类库和组件,并将它们集成到应用程序中。
相关产品
云迁移中心
推荐文章
更多