Home  >  Article  >  Backend Development  >  PHP installation imagick under Linux

PHP installation imagick under Linux

WBOY
WBOYOriginal
2016-08-08 09:32:001098browse
Instructions: php installation directory: /usr/local/php5 php.ini configuration file path: /usr/local/php5/etc/php.ini Nginx installation directory: /usr/local/ nginxNginx website root directory: /usr/local/nginx/html1. Install the compilation toolsyum install wget make gcc gcc-c++ gtk+-devel zlib-devel openssl openssl-devel pcre-devel kernel keyutils patch perl2. Install ImageMagick
System Operation and Maintenance www.osyunwei.com Warm reminder: qihang01 original content is copyrighted. Please indicate the source and original text link when reprintingcd /usr/local/src #Enter the software package storage directory wget http://www.imagemagick.org/download/ImageMagick.tar.gz #Download ImageMagicktar zxvf ImageMagick.tar.gz #Unzipcd ImageMagick-6.7.9-3 #Enter the installation directory./configure --prefix=/usr/local/imagemagick #Configuremake #Compile make install #Install export PKG_CON FIG_PATH=/ usr/local/imagemagick/lib/pkgconfig/​​#Set environment variables3. Install imagickcd /usr/local/srcwget http://pecl.php.net/get/imagick-3.0.1.tgz #Download imagicktar zxvf imagick-3.0.1.tgzcd imagick-3.0.1 /usr/local/php5/bin/phpize #Use phpize to generate the configure configuration file ./configure --with-php-config=/usr/local/php5/bin/php-config -- with-imagick=/usr/local/imagemagick #Configurationmake #Compilemake install #InstallNote: An error occurs during the installation process, usually due to the lack of a compilation tool package As a result, you can follow the prompts and refer to the first step to install the corresponding tool package. After the installation is completed, the following interface will appear. Remember the following path, which will be used later. Installing shared extensions: /usr/local/php5 /lib/php/extensions/no-debug-non-zts-20090626/ #imagick module path 4. Configure php to support imagick vi /usr/local/php5/etc/php.ini #Edit the configuration file and add the following content in the last lineextension="imagick.so"5. Testvi /usr/local/nginx/html/phpinfo.php #Edit, enter The following code phpinfo();?>wq! #Save and exitvi /usr/local/nginx/html/imagick.php #Edit, enter the following code header('Content-type: image/jpeg');$image = new Imagick('www.osyunwei.com.jpg'); // If 0 is provided as a width or height parameter,// aspect ratio is maintained$image->thumbnailImage(300, 225);echo $image;?>

The above introduces the PHP installation imagick under Linux, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn