PHP install imagick extension tutorial

  
php_imagick is a PHP extension that can be used by PHP to call ImageMagick. Using this extension will give PHP the same functionality as ImageMagick, so let's take a look at how php installs imagick under Linux.

Description: php installation directory: /usr/local/php5 php.ini configuration file path: /usr/local/php5/etc/php.ini Nginx installation directory: /usr/local/nginx Nginx website root directory: /Usr/local/nginx/html 1. Install the build tool yum install wget make gcc gcc-c++ gtk+-devel zlib-devel openssl openssl-devel pcre-devel kernel keyutils patch perl 2. Install ImageMagick system operation and maintenance www.osyunwei.com warm Reminder: qihang01 original content copyright, reproduced please indicate the source and original link cd /usr/local/src# enter the package storage directory wgethttp://www.imagemagick.org/download/ImageMagick.tar.gz#Download ImageMagick tar Zxvf ImageMagick.tar.gz#Unzip cd ImageMagick-6.7.9-3#Go to the installation directory ./configure --prefix=/usr/local/imagemagick#config make#compile make install#install export PKG_CONFIG_PATH=/usr/local/Imagemagick/lib/pkgconfig/#Set environment variables 3. Install imagick cd /usr/local/src wgethttp://pecl.php.net/get/imagick-3.0.1.tgz#Download imagick tar zxvf imagick-3.0.1 .tgz cd imagick-3.0.1 /usr/local/php5/bin/phpize# with phpi Ze generates the configure configuration file ./configure --with-php-config=/usr/local/php5/bin/php-config --with-imagick=/usr/local/imagemagick#config make#compile make install#install Remarks : An error occurred during the installation process. Generally, it is caused by the lack of a compilation toolkit. You can refer to the first step to install the corresponding toolkit according to the prompts. After the installation is complete, the following interface appears. Remember the following path, which will be used later. Shared extensions: /usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/#imagick module path 4. Configure php support imagick vi /usr/local/php5/etc/php.ini# Edit the configuration file and add the following to the last line extension="imagick.so" 5. Test vi /usr/local/nginx/html/phpinfo.php#Edit, enter the following code < ?php phpinfo(); ?> ; wq!#Save and exit vi /usr/local/nginx/html/imagick.php#Edit, enter the following code < ?php header('Content-type: image/jpeg'); $image = new Imagick('www .osyunwei.com.jpg'); //If 0 is provided as a width or height parameter, //aspect rat Io is maintained $image->thumbnailImage(300, 225); echo $image; ?>

Copyright © Windows knowledge All Rights Reserved