How to install PDO with sqlite3 driver in PHP

Asked by Ladislav Mrnak

In Ubuntu Server Documentation is explained installation and configuration of LAMP stack but I need to use sqlite3 instead of MySQL. I know that I will have to use PDO with driver for sqlite3. Could you describe the steps necessary to setup this environment?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Tony Mugan
Solved:
Last query:
Last reply:
Revision history for this message
Best Tony Mugan (tmugan) said :
#1

To get SQLIte is easy enough

In a terminal window

sudo apt-get install sqlite php5-sqlite

This is some guide as to what is contained in the php5-sqlite package

"SQLite module for php5
This package provides a module allowing you to use the SQLite self-contained
database engine from within your PHP scripts, eliminating the need for a full
SQL server installation like MySQL or PostgreSQL. It also includes the
pdo_sqlite module, for use with the PHP Data Object extension.

PHP5 is an HTML-embedded scripting language. Much of its syntax is borrowed
from C, Java and Perl with a couple of unique PHP-specific features thrown
in. The goal of the language is to allow web developers to write
dynamically generated pages quickly."

Revision history for this message
Ladislav Mrnak (ladislav-mrnak) said :
#2

Thank you very much, It is all in these packages! But it is necessary to set permissions...

I was persuading it so long, reading books and documentation, searching internet - and I thought I have something bad or missing in installation/configuration. Earlier, I have sucessfully setup it on Windows and on XAMPP for Linux. I have even setup it on Ubuntu - but without setting permission - and that's why it did'nt operate. Permissions is simply a greatly sophisticated trap on us linux beginners ;-)

Revision history for this message
Ladislav Mrnak (ladislav-mrnak) said :
#3

Thanks Tony Mugan, that solved my question.

Revision history for this message
thanks a lot (thanks-bugmenot) said :
#4

Thanks a lot mate,
It is very difficult to sort through the different stacks and find that in pdo sqlite3 is known as sqlite instead of sqlite3 as it is everywhere else.
Thanks again