PHP isn’t working with SQLite

lighttpdPHPsqliteUbuntu

Okay, so this is my first server I'm setting up. I have a system running Ubuntu 11.10. I'm running Lighttpd and have PHP set up, but I want PHP and SQLite to work together. I installed them using:

sudo apt-get install lighttpd
sudo apt-get install php5-cgi
sudo apt-get install sqlite
sudo apt-get install php5-sqlite

PHP works fine, but any script with a sqlite command in it just returns a blank page. I turned on php error messages and ran this script:

<?php
echo sqlite_libversion();
echo "<br>";
echo phpversion();
?>

Which returns:

Fatal error: Call to undefined function sqlite_libversion()

What's gone wrong? 🙁

php -m produces this:

[PHP Modules] bcmath bz2 calendar Core ctype date dba dom ereg exif
fileinfo filter ftp gettext hash iconv json libxml mbstring mhash
openssl pcntl pcre PDO pdo_sqlite Phar posix readline Reflection
session shmop SimpleXML soap sockets SPL sqlite3 standard sysvmsg
sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter zip zlib

Best Answer

Extension in Php.ini file should be:

extension=pdo_sqlite.so
extension=sqlite.so
Related Topic