Server Management
MacOSX Serverに、PHP PECL imagickをインストール 09/08/2011 17:50:50
強力な画像処理ツール、imagemagickをPHPで活用するためのインストール方法まとめ。

まずは、Xcodeが必須。DVDからインストールするか、Apple Developerとして登録後、ダウンロード。

バイナリプログラムの簡易インストールツール、MacPortsをダウンロードしてインストール。
http://www.macports.org/
ターミナルから下記コマンドを打ち、ターミナルからportのコマンドが使えるようにしておく。
$ export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
$ export MANPATH="/opt/local/share/man:$MANPATH"

pear、phpizeをインストールしたいので、
$ port install php5 +pear
としてインストール。大きなオマケapache2もインストールされてしまうが、黙認。
すぐにphpizeのコマンドを使っても動かないので、ターミナルを一旦再起動する。

本体Imagemagickをインストール。
$ port install Imagemagick

imagickの最新stableパッケージを、
http://pecl.php.net/package/imagick/
からダウンロード。解凍後、ディレクトリに移動し、インストール。
$ cd /path/to/the/downloaded/imagick-3.X.X
$ phpize
$ ./configure --with-imagick=/opt/local
$ make
$ sudo make install

/etc/php.iniにエクステンションの設定を追記する。
extension=imagick.so

apache再起動でインストール完了。




Comments

Add comment for this article
Comment
URL
Password (You can revise your comment later with this password.)
Security Code
Input this text in the right textarea.
 



03enterprise

Copyright © Majestic, Inc. Privacy Policy