Php-trie_filter extension module installation

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.