LoginSignup
0
1

More than 3 years have passed since last update.

php-mecabインストール

Posted at

基本的な流れは、こちらを参考にした。
https://qiita.com/yusukeito58/items/36aeb7f6376e7b9b9d7e

一部いまくいかなかったところがあったので以下に記載。

php-mecab入れる際にmakeが反応しない

Makefile.globalをコピーしてMakefileを作成してmakeコマンド実行

// makeコマンド実行
$ make
Build complete.
Don't forget to run 'make test'.

// make install実行
$ sudo make install
// エラーが出る
mkdir: /usr/local/Cellar/php@7.1/7.1.18/pecl: File exists
mkdir: /usr/local/Cellar/php@7.1/7.1.18/pecl: No such file or directory

// エラーが出ているディレクトリを確認
$ ls -al /usr/local/Cellar/php@7.1/7.1.18/pecl
lrwxr-xr-x  1 katsuki_y  admin  23  6 16  2018 /usr/local/Cellar/php@7.1/7.1.18/pecl -> /usr/local/lib/php/pecl

// File existsとあったのでシンボリックリンクを削除
$ unlink /usr/local/Cellar/php@7.1/7.1.18/pecl

// 再度インストール
$ sudo make install
Installing shared extensions:     /usr/local/Cellar/php@7.1/7.1.18/pecl/20160303/

// php.iniに以下を加える
// /usr/local/Cellar/php@7.1/7.1.18/pecl/20160303/mecab.so

これで成功しました!

0
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
0
1