Solved

Installing SQLite3 on Apache/PHP5

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now