Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php error: Class 'Imagick' not found

Tags:

php

I am getting the error "Class 'Imagick' not found". Somehow I need to make this library accessible to php. I am using Php 5.2.6 on Fedora 8. my php_info has no mention of ImageMagick.

I have tried: yum install ImageMagick and restarted apache, which didn't work.

I also added extension=imagick.ext to my php.ini file and restarted apache, which didn't work.

like image 458
Andrew Thomas Avatar asked Sep 24 '10 19:09

Andrew Thomas


People also ask

How do I enable imagick PHP?

To enable Imagick for your website, go to your Site Tools -> Dev -> PHP Manager. Click the PHP Extensions tab and find the entry for the “imagick” extension in the list that appears. Then click the Change value button (pencil icon), select the On radio button for Status and save the changes.

How do I add imagick to PHP?

Navigate to Home - Software - Module Installers, then click on the Manage button next to PHP Pecl. In the next screen, select the required PHP version, then click Apply. You can now enter “imagick” in the Install a PHP Pecl field, and click the Install Now button.

How do I know if PHP imagick is installed?

echo "Version return code is $rcode <br>"; //Print the return code: 0 if OK, nonzero if error. echo alist($out); //Print the output of "convert -version" echo '<br>'; echo '<b>This should test for ImageMagick version 5.


2 Answers

For all to those having problems with this i did this tutorial:

How to install Imagemagick and Php module Imagick on ubuntu?

i did this 7 simple steps:

Update libraries, and packages

apt-get update 

Remove obsolete things

apt-get autoremove 

For the libraries of ImageMagick

apt-get install libmagickwand-dev 

for the core class Imagick

apt-get install imagemagick 

For create the binaries, and conections in beetween

pecl install imagick 

Append the extension to your php.ini

echo "extension=imagick.so" >> /etc/php5/apache2/php.ini 

Restart Apache

service apache2 restart 

I found a problem. PHP searches for .so files in a folder called /usr/lib/php5/20100525, and the imagick.so is stored in a folder called /usr/lib/php5/20090626. So you have to copy the file to that folder.

like image 171
Rodrigo Carmona Avatar answered Sep 21 '22 17:09

Rodrigo Carmona


From: http://news.ycombinator.com/item?id=1726074

For RHEL-based i386 distributions:

yum install ImageMagick.i386 yum install ImageMagick-devel.i386 pecl install imagick echo "extension=imagick.so" > /etc/php.d/imagick.ini service httpd restart 

This may also work on other i386 distributions using yum package manager. For x86_64, just replace .i386 with .x86_64

like image 27
Andrew Thomas Avatar answered Sep 23 '22 17:09

Andrew Thomas