开发者

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.

I get the following error in my PHP error log when launching Apache (and the extension doesn't show in the phpinfo() output):

[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/l开发者_如何学Cib/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.

I used Homebrew to install Imagick 6.7.1-1:

brew install imagemagick
brew link imagemagick

To install the Imagick extension I used PECL provided with XAMPP:

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):

/usr/local/bin
/usr/local/Cellar

You can see the entire output here: 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:

/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

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).

Any advice would be greatly appreciated.

Note: For the record, I'm able to reproduce this issue on another OS X Lion machine.


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. perhaps you are booted into 64bit kernel & trying to run 32version or vice versa.

Just boot into kernel with correct arch

[1] Mac OS X v10.6: Starting up with the 32-bit or 64-bit kernel

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜