CentOS 7 安裝 cmake 3.5.2, OpenCC, opencc4php

cmake 的部份

sudo su

cd

yum remove cmake -y

wget https://cmake.org/files/v3.6/cmake-3.6.2.tar.gz

tar -zxvf cmake-3.6.2.tar.gz

cd cmake-3.6.2

./bootstrap --prefix=/usr/local

make

make install

vi ~/.bash_profile

PATH=/usr/local/bin:$PATH:$HOME/bin

source ~/.bash_profile

cmake --version

OpenCC 的部份

cd

wget https://github.com/BYVoid/OpenCC/archive/refs/tags/ver.1.1.0.tar.gz

tar zxvf ver.1.1.0.tar.gz

cd OpenCC-ver.1.1.0/

make

make install

64位元系統再加入以下這指令

ln -s /usr/lib/libopencc.so.2 /usr/lib64/libopencc.so.2

opencc4php 的部份

cd

git clone https://github.com/NauxLiu/opencc4php.git --depth 1

cd opencc4php/

phpize

./configure --with-opencc=/usr/local/OpenCC --with-php-config=/www/server/php/71/bin/php-config

make test

make

make install

修改 php 設定檔

extension = /www/server/php/71/lib/php/extensions/no-debug-non-zts-20160303/opencc.so

重啟 php

發佈留言

Your email address will not be published. Required fields are marked *.

*
*
You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>