Page 1 of 1

PHP Startup: imagick: Unable to initialize module

Posted: 2013-07-08T00:52:38-07:00
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.

Re: PHP Startup: imagick: Unable to initialize module

Posted: 2013-07-08T05:56:33-07:00
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

Re: PHP Startup: imagick: Unable to initialize module

Posted: 2013-07-08T06:33:15-07:00
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?