The php-trie_filter extension module installs libiconv, which is the dependency of libdatrie
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gztar zxvf libiconv-1.14.tar.gzcd libiconv-1.14./configuremakemake install
2 Installation: libdatrie (http://linux.thai.net /~ Thep/datrie/datrie.html # Download)
tar zxf libdatrie-0.2.4.tar.gz cd libdatrie-0.2.4 ./configure --prefix=/usr/local make make install
Summary of problems during editing
1 compilation error trietool. c: 125: undefined reference to 'libiconv'
./Configure LDFLAGS =-L/usr/local/lib LIBS =-libiconv, which is currently unavailable on virtual machines (the real server does not exist)
2 configure: error: C compiler cannot create executable this error is generally not installed with gcc
yum install gcc gcc-c++
3 libiconv. so.2: cannot open shared object file indicates that the libiconv. so.2 solution cannot be found.
Add a/usr/local/lib line in/etc/ld. so. conf and run/sbin/ldconfig. the file is fixed and no error is reported ~~
Here, trie_filter is used to install the PHP extension.
tar xvf trie_filter-2011-03-21.tarcd trie/usr/local/php/bin/phpize./configure --with-php-config=/usr/local/php/bin/php-configmakemake install
4. generate a dictionary of sensitive words
First, you need to write the sensitive words to be detected into a text file (for example, mingdomain.txt), one sensitive word per line, and then use the dpp program generated in the previous step to process the text file to generate a dictionary.
./Dpp txt_file_path dict_file_path
(For example,./dpp/home/like/software/ming+.txt minganci. dic)
Problem 1./dpp: error while loading shared libraries: libdatrie. so.1: cannot open shared object file: No such file or directory
# Vi/etc/ld. so. add/usr/local/lib to the conf file and run: #/sbin/ldconfig :. /dpp/home/like/software/ming.txt minganci)
Note: replace the content php-ext-trie-filter-maste_support_ch of the extension package if you need to support Chinese