[英]Compiling PHP Imagick Extension for XAMPP 1.7.3 on OS X Lion
I'm having some trouble getting the PHP Imagick extension compiled and running with XAMPP 1.7.3 on OS X Lion.我在使用 XAMPP 1.7.3 在 OS X Lion 上编译和运行 PHP Imagick 扩展时遇到了一些麻烦。
I get the following error in my PHP error log when launching Apache (and the extension doesn't show in the phpinfo()
output):启动 Apache 时,我的 PHP 错误日志中出现以下错误(并且扩展名未显示在
phpinfo()
输出中):
[16-Aug-2011 12:42:31] PHP Warning: PHP Startup: Unable to load dynamic library '/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/imagick.so' - dlopen(/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/imagick.so, 9): no suitable image found. Did find:
/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/imagick.so: mach-o, but wrong architecture in Unknown on line 0
I installed the XAMPP development package.我安装了XAMPP开发package。
I used Homebrew to install Imagick 6.7.1-1:我使用 Homebrew 安装 Imagick 6.7.1-1:
brew install imagemagick
brew link imagemagick
To install the Imagick extension I used PECL provided with XAMPP:为了安装 Imagick 扩展,我使用了 XAMPP 提供的 PECL:
cd /Applications/XAMPP/xamppfiles/bin
sudo ./pecl install imagick
When prompted for the location of ImageMagick I've tried the following paths (with the same result):当提示 ImageMagick 的位置时,我尝试了以下路径(结果相同):
/usr/local/bin
/usr/local/Cellar
You can see the entire output here: https://gist.github.com/1149849您可以在此处查看整个 output: https://gist.github.com/1149849
Additionally I tried grabbing the Imagick PECL (3.0.1 and 3.1.0b) tar from the PECL website and compiling from scratch:此外,我尝试从 PECL 网站获取 Imagick PECL(3.0.1 和 3.1.0b)tar 并从头开始编译:
/Application/XAMPP/xamppfiles/bin.phpize
./configure --with-imagick=/usr/local/bin --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config-5.3.1
make
sudo make install
make test
You can see the output here: https://gist.github.com/1149875您可以在此处查看 output: https://gist.github.com/1149875
I've stumbled across a few articles about this topic on various website, none of which have helped me resolve it.我在各种网站上偶然发现了一些关于这个主题的文章,但没有一篇能帮助我解决这个问题。
I've also tried MacPorts for ImageMagic, with the same result (using /opt/local
as the path during compile).我还尝试了 MacPorts for ImageMagic,结果相同(在编译期间使用
/opt/local
作为路径)。
Any advice would be greatly appreciated.任何建议将不胜感激。
Note: For the record, I'm able to reproduce this issue on another OS X Lion machine.注意:作为记录,我可以在另一台 OS X Lion 机器上重现此问题。
PHP Warning: PHP Startup: Unable to load dynamic library '../imagick.so' {Snip}....no suitable image found. Did find: imagick.so: mach-o, but wrong architecture in Unknown on line 0
It clearly says, the extension is there but architecture is not same your kernel.它清楚地表明,扩展是存在的,但架构与您的 kernel 不同。 perhaps you are booted into 64bit kernel & trying to run 32version or vice versa.
也许您已启动到 64 位 kernel 并尝试运行 32 版本,反之亦然。
Just boot into kernel with correct arch只需使用正确的拱门启动 kernel
[1] Mac OS X v10.6: Starting up with the 32-bit or 64-bit kernel [1] Mac OS X v10.6:启动 32 位或 64 位 kernel
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.