1.安装依赖库
curl -O ftp://linux.thai.net/pub/ThaiLinux/software/libthai/libdatrie-0.2.4.tar.gz
解压:tar -zxvf libdatrie-0.2.4.tar.gz
进入目录:libdatrie-0.2.4
创建安装目录:mkdir istall
运行配置:./configure --prefix=/usr/local/libdatrie0.2.4/install
make && make install
2.安装php7 trie_filter 扩展
下载扩展:wget https://github.com/jiopuud/trie_filter/archive/master.zip
解压:unzip master.zip
进入目录:cd trie_filter-master
生成php配置:phpize (没有的话在php7安装目录bin目录下,也可以用命令查找)
./configure --with-php-config=/usr/local/php7/bin/php-config --with-trie_filter=/usr/local/libdatrie0.2.4/install
make && make install
添加扩展配置
找到php.ini文件,末尾写入:extension=trie_filter.so
重启php-fpm