PHP5.6编译安装imagick扩展

环境:
[root@node10 DB_Data_Backup]# cat /etc/redhat-release 
CentOS release 6.9 (Final)
[root@node10 DB_Data_Backup]# uname -a
Linux node10 2.6.32-696.el6.x86_64 #1 SMP Tue Mar 21 19:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@node14 ~]# php -v
PHP 5.6.35 (cli) (built: Apr 11 2018 17:17:55) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies


准备文件:
ghostscript-9.07.tar.bz2
ImageMagick-6.7.6-9.tar.xz
imagick-3.1.0RC1.tgz
pkg-config-0.28.tar.gz


安装:
tar xf ghostscript-9.07.tar.bz2
cd ghostscript_9.07
./configure --prefix=/usr/local/ghostscript_9.07
make && make install
ln -sf /usr/local/ghostscript_9.07/bin/gs /usr/bin/gs




tar xf ImageMagick-6.7.6-9.tar.xz
cd ImageMagick-6.7.6-9
./configure -prefix=/usr/local/imagemagick -enable-lzw -with-modules && make && make install
export PKG_CONFIG_PATH=/usr/local/imagemagick/lib/pkgconfig
echo $PKG_CONFIG_PATH
/usr/local/imagemagick/bin/convert -version




tar xzvf pkg-config-0.28.tar.gz
cd pkg-config-0.28
./configure  --with-internal-glib --enable-iconv=no --with-libiconv=gnu
make && make install




yum install gtk+-devel
yum update pkg-config


tar xf imagick-3.1.0RC1.tgz
cd imagick-3.1.0RC1
phpize
./configure --with-php-config=/www/wdlinux/phps/56/bin/php-config --with-imagick=/usr/local/imagemagick && make && make install
make install执行结果显示:
installing shared extensions: /Data/app/php5.6.26/lib/php/extensions/no-debug-non-zts-20131226/
Installing header files: /Data/app/php5.6.26/include/php/
生成imagick.so到/Data/app/php5.6.26/lib/php/extensions/no-debug-non-zts-20131226/


手动将imagick.so添加到php.ini文件里,
[root@dev etc]# pwd
/Data/app/php5.6.26/etc
[root@dev etc]# vim php.ini
............
extension="/Data/app/php5.6.26/lib/php/extensions/no-debug-non-zts-20131226/imagick.so"
然后重启php和nginx即可!
[root@dev etc]# /Data/app/php5.6.26/bin/php -m
.....
imagick
 



分割线
感谢打赏
江西数库信息技术有限公司
YWSOS.COM 平台代运维解决方案
 评论
 发表评论
姓   名:

Powered by AKCMS