在 Ubuntu Server 14.04 下安装 ImageMagick 的 PHP5 imagick-3.4.3RC1 扩展
ImageMagick 是一个免费开源、用于编辑、创建、合成图像的工具。ImageMagick 可读取、转换、写入多种格式图像。包括:图像切割、颜色替换、各种效果的应用,图像旋转、组合、文本、直线、多边形、椭圆、曲线、附加到图像伸展旋转、等等。
ImageMagick 遵守 GPL 许可协议,是一个免费工具:完全开放源码,可自由使用、复制、修改、发布;它可运行于大多数操作系统。ImageMagick 几乎可在任何非专有操作系统上编译,无论是 32 位还是 64 位 CPU,包括:Linux、Windows 95/98/ME/NT 4.0/2000/XP、Windows 2003、Windows 7、Windows 8、Macintosh (MacOS 9 /10)、VMS 和 OS/2。ImageMagick 的大多数功能的用法都是使用命令行。
ImageMagick 是一套功能强大、稳定且开源的工具集、开发包。可用来读、写和处理超过 200 多种格式的图片文件,包括流行的 TIF、JPG、JPEG、GIF、 PNG、PDF 以及 PhotoCD 等格式。
ImageMagick 可根据 Web 应用程序的需要动态生成图片, 可对一个(或一组)图片进行缩放、旋转、锐化、减色或增加特效等操作,并将操作结果以相同格式或其它格式保存;对图片的操作,即可通过命令行进行,也可通过 C/C++、Perl、Java、PHP、Python 或 Ruby 编程完成。同时 ImageMagick 还提供了一个高质量的 2D 工具包,部分支持 SVG。ImageMagick 的主要精力集中在性能,减少 Bug 以及提供稳定的 API 和 ABI 上。
01、安装 pecl 扩展库
- root:~# apt-get install php-pear
- Reading package lists... Done
- Building dependency tree
- Reading state information... Done
- The following extra packages will be installed:
- php5-cli php5-readline
- The following NEW packages will be installed:
- php-pear php5-cli php5-readline
- 0 upgraded, 3 newly installed, 0 to remove and 151 not upgraded.
- Need to get 0 B/2,441 kB of archives.
- After this operation, 11.5 MB of additional disk space will be used.
- Do you want to continue? [Y/n] y
- Selecting previously unselected package php5-cli.
- (Reading database ... 123974 files and directories currently installed.)
- Preparing to unpack .../php5-cli_5.5.9+dfsg-1ubuntu4.17_amd64.deb ...
- Unpacking php5-cli (5.5.9+dfsg-1ubuntu4.17) ...
- Selecting previously unselected package php5-readline.
- Preparing to unpack .../php5-readline_5.5.9+dfsg-1ubuntu4.17_amd64.deb ...
- Unpacking php5-readline (5.5.9+dfsg-1ubuntu4.17) ...
- Selecting previously unselected package php-pear.
- Preparing to unpack .../php-pear_5.5.9+dfsg-1ubuntu4.17_all.deb ...
- Unpacking php-pear (5.5.9+dfsg-1ubuntu4.17) ...
- Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
- Processing triggers for php5-fpm (5.5.9+dfsg-1ubuntu4.17) ...
- php5-fpm stop/waiting
- php5-fpm start/running, process 21983
- Setting up php5-cli (5.5.9+dfsg-1ubuntu4.17) ...
- update-alternatives: using /usr/bin/php5 to provide /usr/bin/php (php) in auto mode
- php5_invoke: Enable module mysql for cli SAPI
- php5_invoke: Enable module snmp for cli SAPI
- php5_invoke: Enable module xmlrpc for cli SAPI
- php5_invoke: Enable module ming for cli SAPI
- php5_invoke: Enable module curl for cli SAPI
- php5_invoke: Enable module apcu for cli SAPI
- php5_invoke: Enable module recode for cli SAPI
- php5_invoke: Enable module intl for cli SAPI
- php5_invoke: Enable module json for cli SAPI
- php5_invoke: Enable module sqlite3 for cli SAPI
- php5_invoke: Enable module imagick for cli SAPI
- php5_invoke: Enable module pdo_sqlite for cli SAPI
- php5_invoke: Enable module mysqli for cli SAPI
- php5_invoke: Enable module xsl for cli SAPI
- php5_invoke: Enable module opcache for cli SAPI
- php5_invoke: Enable module pdo_mysql for cli SAPI
- php5_invoke: Enable module gd for cli SAPI
- php5_invoke: Enable module pspell for cli SAPI
- php5_invoke: Enable module pdo for cli SAPI
- php5_invoke: Enable module tidy for cli SAPI
- Setting up php5-readline (5.5.9+dfsg-1ubuntu4.17) ...
- php5_invoke: Enable module readline for fpm SAPI
- php5_invoke: Enable module readline for cli SAPI
- php5_invoke: Enable module readline for cgi SAPI
- Setting up php-pear (5.5.9+dfsg-1ubuntu4.17) ...
- Processing triggers for php5-fpm (5.5.9+dfsg-1ubuntu4.17) ...
- php5-fpm stop/waiting
- php5-fpm start/running, process 23027
- root:~#
复制代码 02、安装开发支持模块
- root:~# apt-get install php5-dev
- Reading package lists... Done
- Building dependency tree
- Reading state information... Done
- The following extra packages will be installed:
- pkg-php-tools
- Suggested packages:
- dh-make
- The following NEW packages will be installed:
- php5-dev pkg-php-tools
- 0 upgraded, 2 newly installed, 0 to remove and 151 not upgraded.
- Need to get 0 B/378 kB of archives.
- After this operation, 3,874 kB of additional disk space will be used.
- Do you want to continue? [Y/n] y
- Selecting previously unselected package php5-dev.
- (Reading database ... 123848 files and directories currently installed.)
- Preparing to unpack .../php5-dev_5.5.9+dfsg-1ubuntu4.17_amd64.deb ...
- Unpacking php5-dev (5.5.9+dfsg-1ubuntu4.17) ...
- Selecting previously unselected package pkg-php-tools.
- Preparing to unpack .../pkg-php-tools_1.11_all.deb ...
- Unpacking pkg-php-tools (1.11) ...
- Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
- Setting up php5-dev (5.5.9+dfsg-1ubuntu4.17) ...
- update-alternatives: using /usr/bin/php-config5 to provide /usr/bin/php-config (php-config) in auto mode
- update-alternatives: using /usr/bin/phpize5 to provide /usr/bin/phpize (phpize) in auto mode
- Setting up pkg-php-tools (1.11) ...
- root:~#
复制代码
|