View Full Version : Imagick PHP Extension
rosenjon
09-14-2006, 10:32 AM
I would like to request the install of the php-pecl-imagick php wrapper.
ImageMagick is a graphics library that appears to already be installed, in some form, on Bluehost's servers. However, the php module for ImageMagick, called imagick, is not installed, and therefore ImageMagick cannot be used via PHP with programs like Tikiwiki.
There is already an RPM for the imagick php extension at: http://acmserver.cs.ucr.edu/~nsoracco/rpms/php-pecl-imagick-0.9.11-1.i686.rpm (This is for Fedora Core 4, which is what I use on my Linux Testing Box)
There are other pecl-php-imagick RPM's that can be found here for other Linux distros - I'm not sure what Bluehost currently uses:
http://rpmfind.net/linux/rpm2html/search.php?query=php-imagick
Please install this php-wrapper for ImageMagick. The GD library, which is currently installed on Bluehost's servers, does not support certain image formats that ImageMagick does support.
rosenjon
09-18-2006, 02:11 PM
First off, I want to thank Bluehost for having outstanding customer support. It took a little while to get the info I needed to install Image Magick for PHP, however that is to be expected anytime you are dealing with such a wide customer base with a varying degree of computer knowledge.
I know there would have been many hosts that would not have accomodated my needs in this respect, however Bluehost did once I told them what I required.
Ok, that's enough for props. I also want to post a tutorial on how to use ImageMagick with PHP. This extension is required for Tikiwiki to use Image Magick as its thumbnailing engine for Image Galleries, and I am sure there are many other php apps out there that use the Imagick extension. Note that Imagick is the Pear extensions that allows PHP to talk directly with Image Magick. Imagick is still in beta, and therefore is prone to bugs, so Bluehost does not want to run it as a shared extension. However, you can compile it into your home folder, as long as ImageMagick-devel is installed on the box you are using....
Tutorial for Imagick-PHP extension installation:
In order to install Imagick, you first need to make sure that ImageMagick-devel is installed on the box where your account is hosted. Go into the shell, and type rpm -q ImageMagick-devel
If the package is installed, it will return Image-magick-devel-xxxx
where xxxx is the version number. If it isn't installed, a message will appear telling you so.
Assuming ImageMagick-devel is installed, you need to download the Imagick PHP extensions, located here: http://pecl.php.net/package/imagick
Latest version, as of this post, is 0.9.11
Place this package in your home directory. Then, in a shell console, type
"tar -zxvf imagick-0.9.11.tgz" while in the home directory (don't type the quotes)
Then type the following commands:
cd imagick-0.9.11
phpize
./configure --prefix=/home/{username}/
make
This will make the imagick.so file into a "modules" folder in your home directory.
Now you can go into php.ini, and in the Paths and Directories section, have:
extension_dir = "/home/{username}/modules" (type with the quotes)
Then, in the dynamic extensions section, type extension="imagick.so" (with the quotes)
You can put your imagick.so extension right under the Zend optimizer .so extension (note that in Bluehost's php.ini, all of the extensions are preceded by a ;, which comments them out - you don't want a ; in from of your imagick extension though, because you want the extension to load)
That is it - now Imagick should be available as a PHP/Pear extension
To check if it loaded, run phpinfo() and see if Imagick is loaded as an extension
Note: where you see {username} in the directory path - replace that with your bluehost username (the one you use to log-into the shell with)
Hope that helps somebody....
nydevcom
10-09-2007, 10:34 PM
I get
login as: user
user@ny-dev.com's password:
Last login: Tue Oct 9 23:13:30 2007 from ool-18bc4152.dyn.optonline.net
user@ny-dev.com [~]# dir
./ backup-9.17.2007_17-51-04_user.tar.gz
../ backup-9.29.2007_13-29-59_user.tar.gz
.bash_history clientscript/
.bash_logout config.m4
.bash_profile config.w32
.bashrc etc/
.contactemail examples/
.cpanel/ images/
.cpanel-datastore/ imagick-2.0.0/
.cpanel-ducache imagick.c
.dns logs/
.emacs mail/
.fantasticodata/ package.xml
.ftpquota php_imagick.h
.htpasswds/ public_ftp/
.lastlogin public_html/
.sqmaildata/ ruby/
.trash/ tmp/
.zshrc vbseo.php
CREDITS vbseocp.php
INSTALL vbseocpform.php
TODO vmware-install.pl
access-logs@ webalizer.conf
admincp/ www@
user@ny-dev.com [~]# cd imagick-2.0.0
user@ny-dev.com [~/imagick-2.0.0]# phpize
Configuring for:
PHP Api Version: 20020918
Zend Module Api No: 20020429
Zend Extension Api No: 20050606
user@ny-dev.com [~/imagick-2.0.0]# ./configure --prefix=/home/{user}/
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for egrep... grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend
checking for PHP extension directory... /usr/lib/php/extensions/no-debug-non-zts-20020429
checking for re2c... exit 0;
checking for gawk... gawk
checking whether to enable the imagick extension... yes, shared
checking whether to enable the imagick GraphicsMagick backend... no
checking Wand-config in default path... found in /usr/bin
checking for magick-wand.h header file... configure: error: Cannot locate header file magick-wand.h
user@ny-dev.com [~/imagick-2.0.0]# make
make: *** No targets specified and no makefile found. Stop.
user@ny-dev.com [~/imagick-2.0.0]# phpize
Configuring for:
PHP Api Version: 20020918
Zend Module Api No: 20020429
Zend Extension Api No: 20050606
user@ny-dev.com [~/imagick-2.0.0]# ./configure --prefix=/home/{user}/
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for egrep... grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend
checking for PHP extension directory... /usr/lib/php/extensions/no-debug-non-zts-20020429
checking for re2c... exit 0;
checking for gawk... gawk
checking whether to enable the imagick extension... yes, shared
checking whether to enable the imagick GraphicsMagick backend... no
checking Wand-config in default path... found in /usr/bin
checking for magick-wand.h header file... configure: error: Cannot locate header file magick-wand.h
user@ny-dev.com [~/imagick-2.0.0]#
jackbenimble4
02-02-2008, 11:16 AM
Wow. I know this was written about a year and a half ago, but thank you so much for this walkthrough! I was able to follow your instructions to install the PDO extension and the pdo_mysql driver.
The PDO Extension already exists on my server, but it couldn't be found for some reason so I resorted to these directions. They worked perfectly. I would've prefered to not have to go to this mess when I want to update the version, but oh well. Thanks again for these great instructions.
synexis
12-07-2009, 03:18 PM
First off, I want to thank Bluehost for having outstanding customer support. --rosenjon
I agree completely. Bluehost's support is among the best I've encountered for any company. I had to switch to a different higher-end web host for most of my work, but I still use Bluehost occasionally and highly recommend them over comparable hosts.
Wow. I know this was written about a year and a half ago, but thank you so much for this walkthrough! --jackbenimble4
And I'm replying more than three years later to say that these instructions are still valid. Thank you!
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.