A-A+

Centos64位下安装php7的imagemagick扩展问题记录

2016年07月14日 CentOS 暂无评论 阅读 235 次
如果您有代购或者代维服务器、PHP网站建设、程序代码修改、系统开发等需求,可以联系我购买付费服务。QQ 379880222

checking if ImageMagick version is at least 6.2.4... found version 6.2.8
checking for MagickWand.h or magick-wand.h header... configure: error: Unable to find MagickWand.h or magick-wand.h header
[root@AY131108184211Z imagick-3.4.0]# cd /usr/local/
[root@AY131108184211Z local]# cd imagemagick/
[root@AY131108184211Z imagemagick]# cd lib
[root@AY131108184211Z lib]# cd pkgconfig/
[root@AY131108184211Z lib]# yum install gtk2-devel
[root@AY131108184211Z pkgconfig]# export PKG_CONFIG_PATH=/usr/local/imagemagick/lib/pkgconfig/
[root@AY131108184211Z pkgconfig]# cd /root/imagick-3.4.0
[root@AY131108184211Z imagick-3.4.0]# /usr/local/php7/bin/phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
[root@AY131108184211Z imagick-3.4.0]# ./configure --with-php-config=/usr/local/php7/bin/php-config --with-imagick=/usr/local/imagemagick
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ANSI C... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local/php7
checking for PHP includes... -I/usr/local/php7/include/php -I/usr/local/php7/include/php/main -I/usr/local/php7/include/php/TSRM -I/usr/local/php7/include/php/Zend -I/usr/local/php7/include/php/ext -I/usr/local/php7/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012
checking for PHP installed headers prefix... /usr/local/php7/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.15.3 (ok)
checking for gawk... gawk
checking whether to enable the imagick extension... yes, shared
checking for pkg-config... /usr/bin/pkg-config
checking ImageMagick MagickWand API configuration program... checking Testing /usr/local/imagemagick/bin/MagickWand-config... It exists
found in /usr/local/imagemagick/bin/MagickWand-config
checking if ImageMagick version is at least 6.2.4... found version 6.7.1 Q16
checking for MagickWand.h or magick-wand.h header... /usr/local/imagemagick/include/ImageMagick/wand/MagickWand.h
checking PHP version is at least 5.1.3... yes. found 7.0.2
libs
-L/usr/local/imagemagick/lib -lMagickWand -lMagickCore -lfreetype -ljpeg -lpng -lfontconfig -lX11 -lbz2 -lxml2 -lz -lm -lgomp -lpthread
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 98304
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
[root@AY131108184211Z imagick-3.4.0]# make install

----------------------------------------------------------------------
Installing shared extensions: /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/
Installing header files: /usr/local/php7/include/php/
[root@AY131108184211Z etc]# vi php.ini

添加extension = "imagick.so" 到/usr/local/php7/etc/php.ini
[root@AY131108184211Z etc]# /root/lnmp restart
=========================================================================
Manager for LNMP V1.0 , Written by Licess
=========================================================================
LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
This script is a tool to Manage status of lnmp
For more information please visit http://www.lnmp.org

Usage: /root/lnmp {start|stop|reload|restart|kill|status}
=========================================================================
Stoping LNMP...
Stopping nginx daemon: nginx.
Gracefully shutting down php-fpm . done
Shutting down MySQL.. SUCCESS!
Starting LNMP...
Starting nginx daemon: nginx.
Starting php-fpm Failed loading opcache.so: opcache.so: cannot open shared object file: No such file or directory
[14-Jul-2016 20:20:32] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/imagick.so' - /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/imagick.so: undefined symbol: zend_new_interned_string in Unknown on line 0
done
Starting MySQL... SUCCESS!
[root@AY131108184211Z no-debug-non-zts-20151012]# cd /root/
[root@AY131108184211Z ~]# cd imagick-3.4.0
[root@AY131108184211Z imagick-3.4.0]# make clean
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la modules/* libs/*
[root@AY131108184211Z imagick-3.4.0]# /usr/local/php7/bin/phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
[root@AY131108184211Z imagick-3.4.0]# ./configure --enable-64 --with-php-config=/usr/local/php7/bin/php-config --with-imagick=/usr/local/imagemagick
checking for egrep... grep -E

。。。。。。此处省略
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
[root@AY131108184211Z imagick-3.4.0]# make install

此处省略
----------------------------------------------------------------------
Installing shared extensions: /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/
Installing header files: /usr/local/php7/include/php/
[root@AY131108184211Z ~]# killall -9 php7-fpm
[root@AY131108184211Z ~]# /etc/init.d/php7-fpm

给我留言