首页 >php教程 >php手册 >PHP 图像

PHP 图像

WBOY
WBOY原创
2016-06-06 20:02:241199浏览

PHP安装imagick-3.1.0RC2时提示: an error occur: fatal error: wand/MagickWand.h: No such file or directory 解决办法: 1.确认已安装 ImageMagick 2.安装pkgconfig 1 2 yum install gtk-devel ,可能是yum install gtk2-devel export PKG_CONFIG_PATH=/us

PHP安装imagick-3.1.0RC2时提示:

an error occur: fatal error: wand/MagickWand.h: No such file or directory

解决办法:
1.确认已安装 ImageMagick
2.安装pkgconfig

1

2

yum install gtk+-devel ,可能是yum install gtk2-devel

export PKG_CONFIG_PATH=/usr/local/ImageMagick/lib/pkgconfig/

1 2

yum install gtk+-devel ,可能是yum install gtk2-devel

export PKG_CONFIG_PATH=/usr/local/ImageMagick/lib/pkgconfig/

1

2

3

4

5

6

7

8

wget -c http://pecl.php.net/get/imagick-3.1.0RC2.tgz

tar zxvf imagick-3.1.0RC2.tgz

cd imagick-3.1.0RC2/

make clean

/usr/local/php/bin/phpize

./configure --with-php-config=/usr/local/php/bin/php-config --with-imagick=/usr/local/ImageMagick

make && make install

ldconfig -v /usr/local/

确认ImageMagick 的安装目录是这个目录

3.重新安装PHP扩展:imagick

“configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.”

1

yum install ImageMagick-devel
2

3

4

5

1

vi /usr/local/php/etc/php.ini

6 7


8

wget -c http://pecl.php.net/get/imagick-3.1.0RC2.tgz

1

2

3

extension = "imagick.so"

#按键盘 ESC 键 退出编辑状态

:wq #保存退出

tar zxvf imagick-3.1.0RC2.tgz cd imagick-3.1.0RC2/

make clean

/usr/local/php/bin/phpize

1

service httpd -k restart

./configure --with-php-config=/usr/local/php/bin/php-config --with-imagick=/usr/local/ImageMagick

make && make install

ldconfig -v /usr/local/

1

2

3

4

5

6

7

wget -c ftp://ftp.kddlabs.co.jp/graphics/ImageMagick/ImageMagick-6.7.7-7.tar.gz

tar zxvf ImageMagick-6.7.7-7.tar.gz

cd ImageMagick-6.7.7-7/

./configure --prefix=/usr/local/ImageMagick/

make

make install

cd ../

Ever go the following error while setting up ImageMagick?

Don’t panic. It’s a simple one and we can fix this right away. You are getting this error because you have only installed the “ImageMagick” package. You need to also install “ImageMagick-devel” and that will fix all the issues.

1

/usr/local/ImageMagick/bin/convert logo: logo.gif

That’s it!! Issue solved.

4. 配置使PHP加载imagick 扩展

1

ll logo.gif

1

vi /usr/local/php/etc/php.ini

1

/usr/local/ImageMagick/bin/identify -list configure

#搜索 extension_dir, PHP 5.3.x中 extension_dir 的默认值一般设置成 #/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/

添加一行记录

1

df -lh

1 2

3

extension = "imagick.so" #按键盘 ESC 键 退出编辑状态 :wq #保存退出
重启PHP, lnmpa 环境下,重启 Apache 即可
1 service httpd -k restart
附 ImageMagick,imagick 下载地址 ImageMagick http://www.imagemagick.org/script/download.php imagick-3.1.0RC2 最新版下载 http://pecl.php.net/package/imagick IMAGEMAGICK 安装教程:
1 2 3 4 5 6 7 wget -c ftp://ftp.kddlabs.co.jp/graphics/ImageMagick/ImageMagick-6.7.7-7.tar.gz tar zxvf ImageMagick-6.7.7-7.tar.gz cd ImageMagick-6.7.7-7/ ./configure --prefix=/usr/local/ImageMagick/ make make install cd ../
测试是否安装成功
1 /usr/local/ImageMagick/bin/convert logo: logo.gif
如果没有提示任何错误,然后检查执行命令时所在的目录 看看是否生成了 logo.gif 这个文件
1 ll logo.gif
查看ImageMagick 版本及配置参数
1 /usr/local/ImageMagick/bin/identify -list configure
附录,linux下查看磁盘的剩余空间
1 df -lh
本文部分内容参考 http://www.g78.net/?p=288 在此感谢 参考文案:http://www.gemingcao.com/archives/linux-imagemagick-imagick.html
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn