How to enable SQLite in PHP on Ubuntu 10.10?
I'm trying to get SQLite working on my server but I'm not having much luck.
I'm a knew to managing my own server and I'm stuck.
I followed these instructions from a post on Stackoverflow
$ sudo apt-get install php5-cli php5-dev make
$ sudo apt-get install libsqlite3-0 libsqlite3-dev
$ sudo apt-get install php5-sqlite3
$ sudo apt-get remove php5-sqlite3
$ cd ~
$ wget http://pecl.php.net/get/sqlite3-0.6.tgz
$ tar -zxf sqlite3-0.6.tgz
$ cd sqlite3-0.6/
$ sudo phpize
$ sudo ./configure
$ sudo make
$ sudo make install
$ sudo apache2ctl restart
But when I get to
sudo make
I get the following error…
/root/sqlite3-0.6/sqlite3.c:607: error: ‘zend_fcall_info’ has no member named ‘object_pp’
/root/sqlite3-0.6/sqlite3.c: At top level:
/root/sqlite3-0.6/sqlite3.c:1446: error: duplicate ‘static’
...
Any thoughts on where I'm going wrong?
Many thanks.
4 Replies
With recent versions of Ubuntu, you just do apt-get install php5-sqlite and you're all set. Not sqlite3, just sqlite. This automatically enables both the old SQLite functions and the new SQLite3 class, as well as the SQLite PDO driver.
@glg:
why are you compiling instead of installing?
I'm new to managing my own server, and using the command line is still new to me, so I hadn't realised that those commands meant I was compiling it.
@hybinet:
why are you compiling instead of installing?
With recent versions of Ubuntu, you just do apt-get install php5-sqlite and you're all set. Not sqlite3, just sqlite. This automatically enables both the old SQLite functions and the new SQLite3 class, as well as the SQLite PDO driver.
No wonder apt-get install php5-sqlite3 didn't work. Do I need to do anything to get my install of PHP to start using SQLite?
@sevenupcan:
No wonder apt-get install php5-sqlite3 didn't work. Do I need to do anything to get my install of PHP to start using SQLite?
Just install php5-sqlite and restart Apache. No further configuration should be necessary, unless your previous attempt to compile SQLite somehow ends up conflicting with the official package. It probably won't, because the compile failed anyway.