Install the phpimagick extension in Linux. Today, I used imagick to expand the server environment because of my work needs. it's lnmp architecture. here I will introduce this stuff a little bit. after reading the above introduction, you will know that imagick is strong.
Today, due to work requirements, I used imagick to expand the server environment. it is an lnmp architecture. here is a little introduction to this stuff.
After reading the above introduction, you will know that imagick is powerful. next we will install it step by step.
First Download ImageMagick
# Wget ftp://ftp.u-aizu.ac.jp/pub/graphics/image/ImageMagick/imagemagick.org/ImageMagick.tar.gz
The latest ImageMagick version is downloaded here. Decompress the package.
# Tar-xzvf ImageMagick.tar.gz // after decompression, enter this directory.
# Cd ImageMagick-6.8.6-5 // This is the ImageMagick directory name after I decompress
#./Configure -- prefix =/usr/local/imagemagick // The first step is to configure and install the SDK.
# Make // Step 2
# Make install // Step 3
Okay. let's install ImageMagick. after installation, let's install imagick.
First Download imgick
# Wget http://pecl.php.net/get/imagick-3.1.0b1.tgz // at any time will change the specific according
# Tar-xzvf imagick.tar.gz // Extract
# Cd imagick-3.0.1 // This is the imagick directory name after I decompress
# Phpize // Check whether there is wood
// The first step is to pay attention to the php configuration path that you installed at the time.
When I installed it in this step, I cried, and you said you couldn't find MagickWand. h.
I saw this error by asking du Niang what she said on the Internet.
I followed the operations on the Internet.
Continue
#./Configure -- with-php-config =/usr/local/php/bin/php-config -- with-imagick =/usr/local/imagemagick
I got an error again. is this about playing with me?
I asked Du Niang again ..
Let's first find the location of pkgconfig.
# Find/usr/local/-name pkgconfig
The result is displayed.
/Usr/local/lib/pkgconfig
/Usr/local/apache --/lib/pkgconfig
/Usr/local/libxml2/lib/pkgconfig
/Usr/local/imagemagick/lib/pkgconfig
After finding so many pkgconfig files, it must be the pkgconifg directory imagemagick.
#/Usr/local/php/bin/phpize
#./Configure -- with-php-config =/usr/local/php/bin/php-config
# Export PKG_CONFIG_PATH =/usr/local/imagemagick/lib/pkgconfig
# Make // Step 2
# Make install // Complete
Execution result display
Indicates that the installation is successful.
Imagick. so is generated in the/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/Directory
Modify php. ini configuration
# Vi/usr/local/php/etc/php. ini
Change
Extension_dir =/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
Add a row
Imagick. so // This is an extension added to imagick.
The last step is apache restart if it is an apache server.
The small editor uses nginx/usr/local/nginx/sbin/nginx-s reload, which is ineffective.
Only
# Kill-USR2 'cat/usr/local/php/var/run/php-fpm.pid 'this way, because nginx runs through php-fpm and takes effect only after restart.
Okay. let's print phpinfo.
The installation of imagick is complete ..
= 5.1.3, ImageMagick> = 6.2.4
Due to work requirements, the extended server environment of imagick is lnmp architecture. below I will introduce this stuff a little. after reading the above introduction, you will know the strong imagick...