Solved

Installing SQLite3 on Apache/PHP5

Posted on 2008-10-11
3
5,425 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
  • 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

828 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