Installing ImageMagick on Ubuntu with PECL is really simple. But i want to share with you how to install it beside to remind myself someday, if i forget how to install it. ImageMagick is a php library for image processing. But they are not developed just for PHP library only, now they have library for Ruby, Perl, Phyton, etc. You can visit their official website here.
Let’s continue to how to install ImageMagick/Imagick on Ubuntu:
- Open your terminal
- Install php-pear if you don’t install it yet with this command:
sudo apt-get install php-pear php5-dev
- Install ImageMagick with this command:
sudo apt-get install imagemagick libmagickwand-dev
- Install imagick with pecl, with this command:
sudo pecl install imagick
- Open your php.ini and add this line:
extension=imagick.so
That’s it, now you can use ImageMagick library in PHP. Have a nice day…
Thinks a lot for you tutorial but I have a problem. When I executed the command sudo pecl install imagick i got this error:
downloading imagick-2.2.2.tgz …
Starting to download imagick-2.2.2.tgz (77,212 bytes)
………………done: 77,212 bytes
11 source files, building
running: phpize
sh: phpize: not found
ERROR: `phpize' failed
Can you help me with this?
Hi Mehdi,
Please be sure you install php5-dev package.
or you can use this command for ubuntu/debian: sudo apt-get install php5-dev
Note: if you use php4, use install php4-dev instead.
Thinks a lot for you tutorial but I have a problem. When I executed the command sudo pecl install imagick i got this error:
downloading imagick-2.2.2.tgz …
Starting to download imagick-2.2.2.tgz (77,212 bytes)
………………done: 77,212 bytes
11 source files, building
running: phpize
sh: phpize: not found
ERROR: `phpize’ failed
Can you help me with this?
Hi Mehdi,
Please be sure you install php5-dev package.
or you can use this command for ubuntu/debian: sudo apt-get install php5-dev
Note: if you use php4, use install php4-dev instead.
Thinks Ivan for your help. Everything works perfectly now.
Thinks Ivan for your help. Everything works perfectly now.
hello, mister ivan! im having issues after doing: the last part of the 3-line installing imagick: "sudo pecl install imagick", gave me this error:
make: *** [imagick_helpers.lo] Error 1
ERROR: `make' failed
i have installed php5-dev package.
what do i do first? =( my box is ubuntu 9. i'm assuming there was a remaining incomplete install in the box since it gave that error. how do i clean it first? or do i have to do that? i'm really the noob of all noobs.
thank you!
travis
hello, mister ivan! im having issues after doing: the last part of the 3-line installing imagick: “sudo pecl install imagick”, gave me this error:
make: *** [imagick_helpers.lo] Error 1
ERROR: `make’ failed
i have installed php5-dev package.
what do i do first? =( my box is ubuntu 9. i’m assuming there was a remaining incomplete install in the box since it gave that error. how do i clean it first? or do i have to do that? i’m really the noob of all noobs.
thank you!
travis
Hi trav,
please run this command:
sudo apt-get install libmagick9-dev
then re-run
sudo pecl install imagick
Cheers.
Hi trav,
please run this command:
sudo apt-get install libmagick9-dev
then re-run
sudo pecl install imagick
Cheers.
Hi, again, Ivan
When I ran libmagick9-dev, it said:
You should explicitly select one to install.
E: Package libmagick9-dev has no installation candidate
it still gave me the same error when i installed imagick. Here's the pastebin link: http://pastebin.com/m74ca08ae
🙁
travis
Hi, again, Ivan
When I ran libmagick9-dev, it said:
You should explicitly select one to install.
E: Package libmagick9-dev has no installation candidate
it still gave me the same error when i installed imagick. Here’s the pastebin link: http://pastebin.com/m74ca08ae
🙁
travis
i think you missed to install: libmagickwand-dev
run this
sudo apt-get installl libmagickwand-dev
i think you missed to install: libmagickwand-dev
run this
sudo apt-get installl libmagickwand-dev
I'm in the same place as Travis. I have the newest version of libmagickwand-dev and I get the same error for libmagick9-dev which I am hoping will ultimately fix the make error
I’m in the same place as Travis. I have the newest version of libmagickwand-dev and I get the same error for libmagick9-dev which I am hoping will ultimately fix the make error
Install the module without building it manually by doing "apt-get install php5-imagick"
Install the module without building it manually by doing “apt-get install php5-imagick”
Then, if you wish to upgrade to the latest beta (which compiles cleanly), download it from : http://pecl.php.net/package/imagick and use pecl to install it with "pecl install {name of downloaded file}"
Then, if you wish to upgrade to the latest beta (which compiles cleanly), download it from : http://pecl.php.net/package/imagick and use pecl to install it with “pecl install {name of downloaded file}”
Note that sometimes Ubuntu (specially Ubuntu Server) will only add the required imagick.ini file for PHP CLI but *not* for Apache2. You might need a last manual step like this:
cp /etc/php5/cli/conf.d/imagick.ini /etc/php5/apache2/conf.d
Just check if phpinfo() *on a Web page* will return the information that ImageMagick is compiled into PHP. If not, try the above command.
@Gwyneth Llewelyn Thanks for the tips.
5. Open your php.ini and add this line: extension=imagick.so
Simple Command
sudo echo "extension=imagick.so" > sudo /etc/php5/apache2/php.ini