简体   繁体   English

PHP imagick安装错误

[英]PHP imagick install error

I have installed the imagick php module and also installed Image Magick using Brew. 我已经安装了imagick php模块,并使用Brew安装了Image Magick。 Once installed and added to my extensions in php.ini I get this error when Apache (XAMPP) starts up. 安装并添加到php.ini中的扩展后,我在Apache(XAMPP)启动时遇到此错误。

dyld: lazy symbol binding failed: Symbol not found: _MagickWandGenesis
Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20090626/imagick.so
Expected in: flat namespace

Google has been no help 谷歌一直没有帮助

Looks like you must compile it by hand as follows: 看起来你必须手动编译它,如下所示:

$ cd /usr/local/src/
$ wget http://pecl.php.net/get/imagick-3.0.1.tgz
$ tar -xzvf imagick-3.0.1.tgz 
$ cd imagick-3.0.1
$ phpize
$ MACOSX_DEPLOYMENT_TARGET=10.6
$ CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"
$ CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
$ CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
$ LDFLAGS="-arch i386 -arch x86_64 -bind_at_load"
$ export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET
$ echo $CFLAGS
$ ./configure --with-imagick=/usr/local//Cellar/imagemagick/6.8.0-10
$ make
$ sudo make install
$ sudo vim /etc/php.ini
$ sudo apachectl restart

This is a extract from this post: http://charles.lescampeurs.org/2013/06/18/add-c-header-include-path-pecl 这是这篇文章的摘录: http//charles.lescampeurs.org/2013/06/18/add-c-header-include-path-pecl

But maybe the easier solution is use the josegonzalez's PHP tap for brew and remove the XAMMP, i use it and works perfect: https://github.com/josegonzalez/homebrew-php 但也许更简单的解决方案是使用josegonzalez的PHP水龙头酿造并删除XAMMP,我使用它并且工作完美: https//github.com/josegonzalez/homebrew-php

This tab have the most stable packages and recent ones for PHP 此选项卡具有最稳定的包和最近的PHP包

Regards 问候

I had the same issue with AMPPS. 我对AMPPS也有同样的问题。 I installed ImageMagick and imagick with homebrew to try and get it working on top of AMPPS. 我安装了ImageMagick并用自制软件设想想要尝试让它在AMPPS之上工作。 When I finally got it to compile - I remember symlinks to the right binaries from the AMPPS folder where involved - I got this error. 当我最终编译时 - 我记得从参与的AMPPS文件夹中找到正确二进制文件的符号链接 - 我收到了这个错误。

Turns out not all the libraries where linked properly. 原来并不是所有正确链接的库。 I think it was the 'nm' command I used to examine the difference between a working imagick.so file on another computer and the one that wouldn't load. 我认为这是'nm'命令我用来检查另一台计算机上的工作imagick.so文件与不加载的文件之间的区别。 Anyway, I've had it with compiling issues and incompatibilities now and will reinstall everything from the ground up myself to solve it. 无论如何,我现在已经有了编译问题和不兼容性,并将从头开始重新安装所有内容以解决它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM