• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

imagick module issues

Biker

Well-known member
#1
Ever since cPanel made changes to how the imagic php module gets loaded, I've been pulling my hair out trying to sort out the following error message.


[24-Mar-2013 14:56:49 America/New_York] 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


I suspect it has to do with this.

Under /usr/lib/php/extensions there are two directories.

no-debug-non-zts-20060613 no-debug-non-zts-20090626

In no-debug-non-zts-20090626 there is one file.

706521 Feb 6 2012 imagick.so

Now... Under /usr/local/lib/php/extensions I see the following:

no-debug-non-zts-20060613 no-debug-non-zts-20090626 no-debug-non-zts-20100525

Under no-debug-non-zts-20090626 the following shows:

349694 May 23 2012 eaccelerator.so
706521 Feb 6 2012 imagick.so
49 Feb 6 2012 no-debug-non-zts-20090626 -> /usr/lib/php/extensions/no-debug-non-zts-20090626
353105 Apr 24 2010 xcache.so

Under no-debug-non-zts-20100525 I see:

706521 Jan 7 08:06 imagick.so
302548 Jan 27 09:12 timezonedb.so

php.conf is pointing to /user/local/lib/php/extensions/no-debug-non-zts-20100525

So, short of ripping everything relating to ImageMagick off the server and redoing it from scratch, is there a simple fix for this?
 

MattW

Well-known member
#2
I suspect you might need to download and manually compile this, as that will then build it for the current directory PHP is expecting the .so to be in.
 

CTXMedia

Formerly CyclingTribe
#4
You appear to have upgraded from PHP 5.3 (20090626) to 5.4 (20100525).

What's interesting is the imagick.so module appears to be newer in the PHP 5.3 extensions directory - no-debug-non-zts-2009062.

Just out of curiosity - rename imagick.so to imagick.so.temp in the no-debug-non-zts-20100525 directory, then copy imagick.so from the no-debug-non-zts-20090626 to the no-debug-non-zts-20100525 directory and restart php and let me know what happens?

Cheers,
Shaun :D
 

Biker

Well-known member
#5
Don't think that will work Shaun. Notice the symlink in the 20090626 directory. And there's no 20100525 directory in /usr/lib/php/extensions.
 

CTXMedia

Formerly CyclingTribe
#6
Don't think that will work Shaun. Notice the symlink in the 20090626 directory. And there's no 20100525 directory in /usr/lib/php/extensions.
Hmmm, okay, but you've said ... "php.conf is pointing to /user/local/lib/php/extensions/no-debug-non-zts-20100525"> which contains the file ... 706521 Jan 7 08:06 imagick.so

I just wondered if replacing that file with the newer one (706521 Feb 6 2012 imagick.so) might work?

I expect, though, it might be easier to just download and recompile (http://pecl.php.net/package/imagick) (y)
 

Biker

Well-known member
#7
No. There are two compiles. You have the ImageMagick which is compiled for the system, and then pecl:imagick for PHP. I'm thinking I have to rip it all out and start from scratch.
 

CTXMedia

Formerly CyclingTribe
#9
No. There are two compiles. You have the ImageMagick which is compiled for the system, and then pecl:imagick for PHP.
True, but I think they work independently to a degree - ImageMagick compiles the module magick.so and is separate to the PHP module.

PHP is complaining (above) about the pecl module compiled to the wrong php version so you should be able to download pecl:imagick, phpize, and recompile to get it working (which should create a new imagick.so module in the current [5.4] php extension directory).

I could be completely wrong but perhaps give it a try? It should only take a few mins. and might save some time/work.

Cheers,
Shaun :D