
推荐:《PHP视频》
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #进入我的下载目录
cd /mydownload
#下载源码包
wget http:
tar xvjf scws-1.2.3.tar.bz2
# 编译安装
cd scws-1.2.3
./configure --prefix=/usr/local/scws
make
make install
# 下载词库
cd /usr/local/scws/etc
wget http:
wget http:
tar xvjf scws-dict-chs-gbk.tar.bz2
tar xvjf scws-dict-chs-utf8.tar.bz2
# 重新回到SCWS源码 编译PHP扩展
cd /mydownload/scws-1.2.3/phpext
phpize
/www/server/php/72/bin/php-config
./configure --with-scws=/usr/local/scws --with-php-config=/www/server/php/72/bin/php-config
make
make install
# php.ini添加PHP扩展
php --ini
echo 'extension=scws.so'>>/www/server/php/72/etc/php.ini
echo 'scws. default .charset=utf8'>>/www/server/php/72/etc/php.ini
echo 'scws. default .fpath=/usr/local/scws/etc'>>/www/server/php/72/etc/php.ini
|
Salin selepas log masuk
Atas ialah kandungan terperinci 中文分词 PHP 扩展 SCWS 安装方法. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!