1. 获取scws
#cd /usr/local
#wgethttp://www.ftphp.com/scws/down/scws-1.1.7.tar.bz2
#tar xvjf scws-1.1.7.tar.bz2
2. 安装scws
#cd /usr/local/scws-1.1.7
#./configure --prefix=/usr/local/scws
#make
#make install
3. 获取词库
#cd /usr/local/scws/etc
#wgethttp://www.ftphp.com/scws/down/scws-dict-chs-gbk.tar.bz2
#wgethttp://www.ftphp.com/scws/down/scws-dict-chs-utf8.tar.bz2
#tar xvjf scws-dict-chs-gbk.tar.bz2
#tar xvjf scws-dict-chs-utf8.tar.bz2
4. 安装php扩展
#ln -s /usr/local/scws/lib/libscws.so.2.0 /usr/local/scws/lib/libscws.so 这一步一定要加上,官方没有指出,主要针对freebsd8.x
#cd /usr/local/scws-1.1.7
#phpize
#./configure --with-scws=/usr/local/scws/ --with-php-config=/usr/local/bin/php-config
#make
#make install
#vi + /usr/local/etc/php.ini 增加下面内容
[scws]
extension="scws.so"
scws.default.charset="utf8"
scws.default.fpath="/usr/local/scws/etc"
#php -m 查看是否有scws 或 phpinfo()