[備忘]CentOS7.4 php7.1 にmecab入れたときのメモ

rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm
yum makecache
yum install mecab mecab-ipadic

yum install mecab-devel
git clone https://github.com/rsky/php-mecab.git
cd php-mecab/mecab/
phpize
./configure
make
make test
make install
vi /etc/php.d/40-mecab.ini

git clone –depth 1 https://github.com/neologd/mecab-ipadic-neologd.git
cd mecab-ipadic-neologd
./bin/install-mecab-ipadic-neologd -n

mecab -d /usr/lib64/mecab/dic/mecab-ipadic-neologd


<?php
$sstr = ‘適当な文字列’;
$opts = [‘-d’=>’/usr/lib64/mecab/dic/mecab-ipadic-neologd’];

$cMT = new \MeCab\Tagger($opts);
$nodes = $cMT->parseToNode($sstr);

foreach ($nodes as $datum) {
echo $datum->getSurface(), “\n”;
echo $datum->getFeature(), “\n”;
}

[備忘]CentOS7.4 httpd+php7.1+mysql5.7+Imagick 入れたときのメモ

yum -y groupinstall base
yum -y groupinstall development
yum -y groupinstall network-tools
yum -y update
yum -y install epel-release
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm –import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
rpm -ivh http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
vim /etc/yum.repos.d/remi.repo
yum -y install httpd-devel
yum -y install mod_ssl
yum –enablerepo=remi,remi-php71 install php php-devel php-pdo php-mysqlnd php-mbstring php-mcryp php-gd php-pear php-pecl-apc-devel zlib-devel
yum -y install mysql-devel
yum -y install mysql-server
yum install ImageMagick ImageMagick-devel
pecl channel-update pecl.php.net
pecl install imagick