Chinese word segmentation PHP extension SCWS installation method

藏色散人
Release: 2023-04-09 17:04:01
forward
3916 people have browsed it

Chinese word segmentation PHP extension SCWS installation method

Recommended: "PHP Video"

#进入我的下载目录
cd /mydownload

#下载源码包
wget http://www.xunsearch.com/scws/down/scws-1.2.3.tar.bz2

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://www.xunsearch.com/scws/down/scws-dict-chs-gbk.tar.bz2

wget http://www.xunsearch.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

# 重新回到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
Copy after login

The above is the detailed content of Chinese word segmentation PHP extension SCWS installation method. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!