Solved

Installing SQLite3 on Apache/PHP5

Posted on 2008-10-11
3
5,447 Views
Last Modified: 2013-12-13
I've heard sqlite should be built in to php5 but for some reason it wasn't.
I ran apt-get install php5-sqlite3 and successfully got phpinfo() to show:

SQLITE3
SQLite3 support       enabled
sqlite3 library version       3.3.13

However when I run sqlite_open('database.sqlite') I get:

Call to undefined function sqlite_open()

How can I find out what's wrong? Any commands to try, or logs to check?

BTW, using Ubuntu and Apache 2.2.3.

Thanks
0
Comment
Question by:oct11
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
torimar earned 500 total points
ID: 22694763
Hi,

it could be this bug you just hit:
https://bugs.launchpad.net/ubuntu/+source/php-sqlite3/+bug/178906

On the Ubuntu forums, a successful workaround is said to have been this:
sudo aptitude install sqlite
sudo aptitude install php5-sqlite
sudo aptitude install sqlite3
sudo aptitude install php5-sqlite3
sudo /etc/init.d/apache2 restart


Hope this helps.
0
 

Author Comment

by:oct11
ID: 22695401
Yeah, it seems to at least partly relate to that bug.

Using that workaround I could make sqlite3 work by using PDO, but I could not use it with with function on http://se.php.net/sqlite.

Do you (or anyone) know if I could use the native sqlite functions if I recompiled PHP with the '--with-sqlite=/path/to/sqlite3' statement? (as explained here http://devzone.zend.com/node/view/id/760#Heading6)
0
 
LVL 35

Expert Comment

by:torimar
ID: 22696163
I don't exactly know, but I'm sure I'd try if I were in your position.

Good luck.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question