My goal is to convert pdf files to images so i can use them as thumbnails on a website. I use codeigniter and XAMPP. However Im running into problems when trying to load the php wrapper to image magic. What i have done:
I used brew to install ghostscript(ghostscript: stable 9.14) and imagemagick(imagemagick: stable 6.8.8-9).
After that i proceeded to install imagick 3.1.2 (the php wrapper to imagemagick) with pecl that is bundled with my xampp installation. No problems so far.
I have tested to: convert file.pdf file.jpg, this works fine and without problem.
I have added "extension=imagick.so" to my php.ini
When i look in my phpinfo() imagick isn't listed so i took at look at the php_errors_log:
[25-Apr-2014 19:24:11 Europe/Berlin] PHP Warning: PHP Startup: Unable to load dynamic library '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts- 20121212/imagick.so' - dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/imagick.so, 9): Library not loaded: /usr/local/lib/libfreetype.6.dylib Referenced from: /usr/local/lib/libMagickWand-6.Q16.2.dylib Reason: Incompatible library version: libMagickWand-6.Q16.2.dylib requires version 18.0.0 or later, but libfreetype.6.dylib provides version 17.0.0 in Unknown on line 0
Obviously is the libfreetype.6.dylib not a high enough version, i have the latest XQaurts installed, at least according to my OS which is OS X Mavericks 10.9.2.
I can't seem to locate a libfreetype.6.dylib that is a version 18.0.0 anywhere on the Internet.
I have also tried an older version on homebrew, imagemagick-ruby186, with that version i could not convert the pdf in terminal.
In this thread Incompatible library version: imagick.so requires version 18.0.0 or later, but libfreetype.6.dylib provides version 16.0.0 in Unknown on line 0 there is a similar problem described, however that person is using MAMP and is able to comment out the
/Applications/MAMP/Library/bin/envvars
I can't seem to locate a similar file in the XAMPP stack. Does anyone know where i can find the required version of the libfreetype.6.dylib or any other solution to this problem?
This would be very appreciated. I have been battling this problem for 12 hours now and I would love to start coding my app instead of trying to install stuff.
Hopefully this question can hope others with similar problems.
Best regards, Johan