VM_pa203:

環境參數:

[parker@pa203 ~]$ cat /etc/redhat-release
CentOS release 6.9 (Final)
[parker@pa203 ~]$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)

參考網頁:

想辦法提升 gcc 版本,又不影響 centos 6 版的系統運作:
安裝 devtoolset:2017年12月14日 星期四 devtoolset 3

安裝完成後,確認 gcc 版本:
[root@pa203 parker]# sudo cat /etc/redhat-release
CentOS release 6.9 (Final)
[root@pa203 parker]# gcc --version                
gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
安裝 openCC:

安裝 opencc4php:

參考資料:



ftp://ftp.gnu.org/gnu/gcc/

opencc-1.0.3-3.mga6.x86_64.rpm:
opencc-1.0.3-3.mga6.x86_64.rpm



Linux | OS X

你需要先安装1.0.1 版本以上的OpenCC,安装OpenCC:

git clone https://github.com/BYVoid/OpenCC.git --depth 1
cd OpenCC
make
sudo make install

安装opencc4php:

git clone [email protected]:NauxLiu/opencc4php.git --depth 1
cd opencc4php
phpize
./configure
make && sudo make install


套件不符造成無法安裝問題筆記:
make 時產生錯誤,必須安裝 gcc 4.8 以上版本

gcc 4.8 安装
]# curl -Lks http://www.hop5.in/yum/el6/hop5.repo > /etc/yum.repos.d/hop5.repo
]# yum install gcc gcc-g++
]# gcc -v
使用內建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/lto-wrapper
目的:x86_64-redhat-linux
配置為:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,fortran,lto --enable-plugin --enable-initfini-array --without-isl --without-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
執行緒模型:posix
gcc version 4.8.2 20131212 (Red Hat 4.8.2-8) (GCC)