TurnKey Linux Virtual Appliance Library

LAMP and PDO SQLITE

Hi.

I need to add support for SQLite on my LAMP. I just don't find the way to install PDO Sqlite for PHP via apt-get...

Suggestion?

Thanks a lot!

Hello Maxime, i think apt-get

Hello Maxime,

i think apt-get install php5-sqlite does the trick.

 


need to recompile php with 'sqlite' or 'pdo_sqlite' extensions

How can I go about just recompiling the additional extensions and not the whole shabang?

Thanks

I also need SQLite (especially the PDO-implementation for PHP)

"apt-get install php5-sqlite" also installs a bunch of other packages it depends on and that may or may not be what you want. For example the installation of PHP is also modified to its latest version. You might want to be cautious when you do this.

At the point of writing this post, SQLite (and thus the PDO-implementation, which I needed it for) is still not supported on the current LAMP stack.

The following is a copy/paste from the output generated when executing this specific apt-get command:

 

The following extra packages will be installed:

  libapache2-mod-php5 lsof php5-cli php5-common php5-mcrypt php5-mysql

The following NEW packages will be installed:

  lsof php5-sqlite

The following packages will be upgraded:

  libapache2-mod-php5 php5-cli php5-common php5-mcrypt php5-mysql

5 upgraded, 2 newly installed, 0 to remove and 22 not upgraded.

Need to get 6366 kB of archives.

After this operation, 1340 kB of additional disk space will be used.

Do you want to continue [Y/n]?

After typing "Y" you get a notice from the package manager:

 ┌─────────────────────┤ Modified configuration file ├──────────────────────┐

  │ A new version of configuration file /etc/php5/cli/php.ini is available,  │ 

  │ but the version installed currently has been locally modified.           │ 

  │                                                                          │ 

  │ What do you want to do about modified configuration file php.ini?        │ 

  │                                                                          │ 

  │           install the package maintainer's version                       │ 

  │           keep the local version currently installed                     │ 

  │           show the differences between the versions                      │ 

  │           show a side-by-side difference between the versions            │ 

  │           start a new shell to examine the situation                     │ 

  │                                                                          │ 

  │                                                                          │ 

  │                                  <Ok>                                    │ 

  │                                                                          │ 

  └──────────────────────────────────────────────────────────────────────────┘ 

This choice was kind of hard for me to make so I 'd appreciate input from TurnKey on what would be the best choice here.

Jeremy's picture

TBH I'm not sure on the initial config...

/etc/php5/cli/php.ini is the config file for php5-cli; which essentially allows php programs to be run from the commandline. Generally the 'normal' php.ini (/etc/php5/apache2/php.ini) is more important as it will affect the way that php apps run in the web browser. My personal take would be that unless you have configured php to do anything specific on the commandline then install the new config file. You can always tweak it later. FWIW TurnKey includes etckeeper by default so your old php.ini will be saved within the /etc git repo anyway.

"Install the package maintainers version"

Update : I dove into the code and compared the different php.ini files that the package manager was yammering about.

After this, I felt sure enough to pick the "Install the package maintainers version" - option, which is, after all, the version that belongs with the new PHP version.

It seems silly to have a php.ini from one PHP version to go with the other, so installing the new version would be the logical thing to do.

I've been further developing and testing a SQLite PHP application which I git-pulled onto the box and everything seems to work nicely (and as a plus, the error stack looks much better in a browser now ;-) ).

 

Hoping this might save someone some confusion.

Jeremy's picture

I probably should have read this before posting above...

Sounds like you answered the question yourself! :) Anyway I hope the extra info I posted above will be useful for future reference (and/or for anyone else...).

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)