PHP Startup: imagick: Unable to initialize module

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
midnig
Posts: 2
Joined: 2013-07-08T00:48:08-07:00
Authentication code: 6789

PHP Startup: imagick: Unable to initialize module

Post by midnig »

I have MAMP 2.0 on my mac. I installed ImageMagick and then tried to install/configure imagick. In the end I had an imagick.so file which I copied to the various php 5.n directories under /Applications/MAMP/.

Whenever I start Apache, this error message is produced:

Code: Select all

PHP Warning:  PHP Startup: imagick: Unable to initialize module
Module compiled with module API=20090626
PHP    compiled with module API=20100525
These options need to match
 in Unknown on line 0
and there is no trace of imagick in phpinfo().

What do I have to do to compile imagick with API=20100525?

Naturally I'd be happy to provide any other information that may be needed to solve the problem.
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Re: PHP Startup: imagick: Unable to initialize module

Post by mkoppanen »

It looks like you have compiled Imagick against different PHP version. Try using:

Code: Select all

./configure --with-php-config=/path/to/correct/version/php-config
Mikko Koppanen
My blog: http://valokuva.org
midnig
Posts: 2
Joined: 2013-07-08T00:48:08-07:00
Authentication code: 6789

Re: PHP Startup: imagick: Unable to initialize module

Post by midnig »

Thanks for the reply.

Can I leave my current ImageMagick installation as is and just do what you suggested for imagick (i.e. to generate the correct version of imagick.so)?

Maybe this info will help: I used phpize to create imagick.so, not PECL. When I run phpize with the -v option, this is the output:

Code: Select all

Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
Obviously it should be 20100525 and not 20090626. How can I get the correct version of phpize?
Post Reply