1.安装libiconv,这个是libdatrie的依赖项
$ wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
$ tar zxvf libiconv-1.16.tar.gz
$ cd libiconv-1.16
$ ./configure
$ make
$ make install
2.安装libdatrie(http://linux.thai.net/~thep/datrie/datrie.html#Download)
$ wget http://linux.thai.net/pub/ThaiLinux/software/libthai/libdatrie-0.2.11.tar.xz
$ xz -d libdatrie-0.2.11.tar.xz // 先解压xz
$ tar -xvf libdatrie-0.2.11.tar.xz // 再解压tar
$ cd libdatrie-0.2.11
$ make clean
$ ./configure --prefix=$LIB_PATH
$ make
$ make install
3.安装扩展php-ext-trie-filter
$ git clone https://github.com/wulijun/php-ext-trie-filter.git
$ cd php-ext-trie-filter
$ $INSTALL_PHP_PATH/bin/phpize
$ ./configure --with-php-config=$INSTALL_PHP_PATH/bin/php-config --with-trie_filter=$LIB_PATH
$ make
$ make install
4.然后修改php.ini,增加一行:extension=trie_filter.so,然后重启PHP。