$ cd /data/opencc $ git clone https://github.com/BYVoid/OpenCC.git $ cd OpenCC/ $ make $ make install $ # 验证是否安装成功 $ opencc --version
Open Chinese Convert (OpenCC) Command Line Tool Version: 1.0.5
PS: 如果提示:opencc: error while loading shared libraries: libopencc.so.2: cannot open shared object file: No such file or directory 错误, 是因为 64位系统没有对应的链库导致的。执行以下命令:
$ cd /usr/local $ git clone https://github.com/NauxLiu/opencc4php.git $ cd opencc4php $ phpize //具体的文件地址自行查找 $ ./configure --with-opencc=/data/OpenCC --with-php-config=/usr/local/php/bin/php-config //自行修改 opencc目录和 php-config目录 $ make test //测试有什么问题没有 $ make $ make install