Installing php-enchant on Ubuntu 8.4

For the upcoming version of the online spellchecker for spellchecker.lu I decided to use a combination of enchant/hunspell as the core spellchecking engine. However, the versions of libenchant and hunspell that come with the new Ubuntu 8.4 are not really up-to-date, so I compiled my own versions. As a reference for myself, this is a small howto:

Remove old versions if they are installed:

apt-get remove --purge libenchant1c2a libenchant-dev hunspell

Install necessary development libraries

apt-get install libglib2.0-dev
apt-get install php5-dev php-pear

Installing hunspell and enchant is pretty straightforward:

# Install hunspell
tar xzvf hunspell-1.2.2.tar.gz
cd hunspell-1.2.2
./configure --libdir=/usr/lib/
make install

# Install enchant:
tar xzvf enchant-1.4.1.tar.gz
cd enchant-1.4.1
./configure --with-myspell-dir=/usr/share/myspell/dicts --libdir=/usr/lib/
make install

Now php-enchant can be installed very easily using pecl:

pecl install enchant

To enable the php extension, I did this:

echo "extension=enchant.so" > /etc/php5/conf.d/enchant.ini

That’s it. A usage example can be found in the PHP manual:
http://php.net/manual/en/enchant.examples.php

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • del.icio.us
  • Facebook
  • Google
  • Slashdot
  • Technorati
  • StumbleUpon

2 Responses to “Installing php-enchant on Ubuntu 8.4”


  1. 1 spellcheck

    Great advice, I hope the guys will put the latest enchant into the package library. Also, I would mention PECL as a prerequisite.

  1. 1 TinyMCE spellchecker plugin with enchant library at Michel Weimerskirch

Leave a Reply