phpThumb cannot find ImageMagick / Imagick

4.7k Views Asked by At

I'm having a problem with phpThumb. It says in the documentation that to get the best out of it, use ImageMagick / Imagick.

I've got this installed on the Server (running Centos 5.1), and can run convert --version and get the right info back. I can also run which convert which returns /usr/bin/convert

However, phpThumb can't location the convert program - the demo's show that:

(requires ImageMagick, this server is running "n/a" so it will not work)

Does anyone have any pointers on how to fix this?

Cheers,
Matt

3

There are 3 best solutions below

3
On

ImageMagick changed the way it reports the version, and phpThumb no longer recognizes the version info.

From:

Version: ImageMagick 6.3.7 06/04/09 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC

To:

Version: ImageMagick 6.6.2-6 2010-12-02 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC

There are now DASHES in the version! This is a simple fix, open phpthumb.class.php look for the line:

if (eregi('^Version: [^0-9]*([ 0-9\\.\\:Q/]+) (http|file)\:', $versionstring[1], $matches)) {

Simply add a dash '-' after the Q/ and it will work. New line:

if (eregi('^Version: [^0-9]*([ 0-9\\.\\:Q/-] (http|file)\:', $versionstring[1], $matches)) {
1
On

Have you checked phpinfo() to make sure imagick is installed? If not, you will need to install it.

ImageMagick Install Instructions

0
On

The problem with phpThumb is often not a missing ImageMagick problem, but a problem with access to the exec function, because phpThumb is using binaries (convert) to create thumbnails. Make sure You have seen this http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=phpThumb and http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-1598