LoginSignup
1
1

More than 5 years have passed since last update.

PDF Image GeneratorをMacで使うための準備

Posted at

PDF Image Generatorとは

PDFをアップロードすると同時にサムネイルを自動で作ってくれるプラグインです。

動作するための前提条件

imagemagick
ghostscript
imagick
というライブラリに依存してるみたいなのでこれらをインストールする必要があるようです。
これらをインストールしないとプラグインを有効化できません。

必要な手順

1. imagemagickをインストールする

$ brew install imagemagick

2. ghostscriptをインストールする

$ brew install ghostscript

3. pearをinstallする

※ホームディレクトリにインストールする前提で書いてます。
$ cd ~/
$ curl -O http://pear.php.net/go-pear.phar

何か聞かれたら全部Enterで良いと思います。

4. pearへのパスを通す

~/.bash_profileに以下を追加する。

export PATH="$PATH:$HOME/pear/bin"

bash_profileの変更を反映させるため以下コマンドを打つ。
$ source ~/.bash_profile

※もしpearをホームディレクトリ以外にインストールした場合は適宜パスを変えてください。

5. imagickをインストールする

4.でpearをインストールするとpeclというコマンドが使えるようになるはずです。
以下のコマンドを打ってimagickをインストールしましょう。

$ pecl install imagick

6. php.iniを修正する。

まず使用してるphpのバージョンを調べます。
image.png

MAMPのPreferences...から確認できます。
使用しているバージョンに対応するディレクトリの中にあるphp.iniを開きます。
/Applications/MAMP/bin/php/php7.1.1/conf/php.ini

extension=imagick.soを追加。(;Extensinosと書いてあるところに追加すれば良いと思います。)

以上。
これでPDF Image Generatorプラグインを有効化できるようになるはずです。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1