Jun 28, 2012

Solution to ubuntu 12.04 sqlite missing

Yesterday I upgrade Ubuntu on my PC in office from 11.10 to 12.04, everything seemed ok.
However, unfortunately, this morning when I tried to clean cache of a symfony project, it reported a Fatal error:

PHP Fatal error:  Class 'SQLiteDatabase' not found in /home/htsg/workspace/esr-momentum/lib/vendor/symfony/lib/cache/sfSQLiteCache.class.php on line 166

After searching online,  I found that 12.04 uses sqlite3 as default, and doesn't install sqlite any more.

I tried a solution which install obsoleted lib via pecl, but failed when did make.
So I had to try another way:
1. downloaded a old version sqlite package from http://packages.ubuntu.com/natty-updates/php5-sqlite
2. extracted the deb file, found the sqlite.so file, copy it to /usr/lib/php5/20090626
3. change the file privilege to root:root
4. create a new configure file sqlite.ini in /etc/php5/conf.d, whose content is
    extension=sqlite.so
5. sudo service apache2 restart

done.

No comments:

Post a Comment