-2

It seems that recent versions of php (5.3 and above?) the sqlite driver for pdo is not installed/enabled by default. This, despite official claims to the contrary.

Although there appears to be an easy fix for linux/debian/ubuntu users thanks to apt-get I'm having trouble fixing this on OSX (I think ampps works OK, but that lacks other extensions I need, and mac ports doesn't work). Anyone have a fix for this? (failing that, more info?)

Community
  • 1
  • 1
iPadDeveloper2011
  • 4,560
  • 1
  • 25
  • 36
  • Check here http://abouthalf.com/development/php-in-snow-leopard/ – Yogus Jun 12 '13 at 01:32
  • Thx @Yogus I may be able to find something in that. That page is largely about mysql (not sqlite) however. – iPadDeveloper2011 Jun 12 '13 at 02:34
  • google is your friend [this question has been asked](http://stackoverflow.com/questions/7186371/how-do-i-enable-sqlite3-in-os-x-10-5-8-with-php) – Joe Jun 12 '13 at 06:24
  • @Joe. Although I find the ubiquitous "google is your friend" comment terribly annoying (after googling this for most of the day) the link you provided was helpful. Thank you. – iPadDeveloper2011 Jun 13 '13 at 02:47
  • Also, its not the same question. My question is specifically about the sqlite _pdo driver_. – iPadDeveloper2011 Jun 13 '13 at 02:58
  • possible duplicate of [macports apache2 install missing pdo drivers](http://stackoverflow.com/questions/16975056/macports-apache2-install-missing-pdo-drivers) – apaderno Jun 13 '13 at 05:24
  • @iPadDeveloper2011 I apologise for that google bit, I was feeling a bit snarky when I wrote that, and shouldn't have vented it on you. – Joe Jun 13 '13 at 20:24
  • I'm starting to get really annoyed with heavy handed SO 'moderators' who mess with helpful questions/answers. Note that the question that this one is ment to be a duplicate of is specifically about macports, while this one isn't. Also, the other question has had the answer deleted. Non mentally challenged people might mark that one as the duplicate (leaving at least one helpful question/answer intact) – iPadDeveloper2011 Jun 17 '13 at 04:37

1 Answers1

2

What worked for me:

sudo port install php5-sqlite
sudo port install php5 +apache2 +sqlite

The second line here didn't seem to do anything, but you never know.

After restarting I noticed I didn't have imagemagick, which I thought I already had, so

sudo port install php5-imagick

Now restarting apache2 the "macports" way:

sudo port unload apache2
sudo port load apache2

And looking at phpinfo, I have sqlite2 and sqlite (which, confusingly, is sqlite3) drivers enabled for pdo.

iPadDeveloper2011
  • 4,560
  • 1
  • 25
  • 36