WebFaction
Community site: login faq

I need the Imagick extension in PHP 5.3 for image manipulation. How do I install it?

asked 17 Dec '11, 03:27

neeravk
1.5k3412
accept rate: 41%


You can build it for PHP 5.3 using the following list of commands over SSH:

# Procedure for installing IMagick for PHP5.3 on a PHP+CGI server
# Create an install directory
mkdir ~/pecl_install
cd ~/pecl_install
# Download the last version of Imagick (as seen at http://pecl.php.net/package/imagick)
wget http://pecl.php.net/get/imagick-3.0.1.tgz
# Unpack and get inside the extracted dir
tar xzvf imagick-3.0.1.tgz
cd imagick-3.0.1
# Generate the configuration script
phpize53
# Configure for php53 and make
./configure --with-php-config=/usr/local/bin/php53-config
make
# Create a folder where the custom PHP extensions would live
mkdir ~/php53-exts
# Copy the compiled extension to the custom folder
cp modules/imagick.so ~/php53-exts/
# (Optional) Link the default server extensions inside the new folder, so they are still accessible
ln -s /usr/local/lib/php53/extensions/no-debug-non-zts-20090626/* ~/php53-exts/

# Customize the php.ini file of the desired web application, so that it loads the new extension
# MAKE SURE to replace 'htdocs' with the specific application you are enabling this for
echo "extension_dir = $HOME/php53-exts" >> ~/webapps/htdocs/php.ini
echo "extension = imagick.so" >> ~/webapps/htdocs/php.ini
permanent link

answered 17 Dec '11, 03:28

neeravk
1.5k3412
accept rate: 41%

PHP54 won't work with version 3.0.1 you can use the latest version to fix this,

wget http://pecl.php.net/get/imagick-3.1.0RC2.tgz
tar xzvf imagick-3.1.0RC2.tgz
cd imagick-3.1.0RC2
phpize54
./configure --with-php-config=/usr/local/bin/php54-config
make
cp modules/imagick.so ~/php54-exts/
(20 Aug '12, 23:22) johns

If you're still having trouble (phpinfo() doesn't show the correct version of ImageMagick), then see this guide.

(01 Jun '13, 19:29) ryans ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×265
×10
×2

question asked: 17 Dec '11, 03:27

question was seen: 22,149 times

last updated: 01 Jun '13, 19:29

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM