1

I want to install the Symfony framework on my MAMP stack. However, when I try to run it, Symfony complains that I need to "Install and enable the SQLite3 or PDO_SQLite extension." I don't know how to do this. I have sqlite3 installed

$ sqlite3 --version
3.4.0

Also I have php 5.3.6. I see that there is a MacPorts package called php5-sqlite3, but it is marked "obsolete port."

What is the correct way to enable the sqlite3 extension on MAMP? I have Leopard 10.5.8.

Edit: I ended up solving the problem by installing the MacPorts package php5-sqlite (without the 3). Then it still didn't work. Then I reinstalled the MacPorts php5 package using +sqlite. Then everything worked. So, that's:

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

I hope that'll help anyone who stumbles onto this...

Robert Martin
  • 16,759
  • 15
  • 61
  • 87

4 Answers4

4

install module

sudo port install php5-sqlite

and then restart apache2

sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart

There is no need to uninstall php5

johansenj
  • 71
  • 4
  • I can't verify this works (since I already fixed on my computer), but if other people try it and it works, please upvote/post so I can switch correct answer – Robert Martin Jan 25 '12 at 05:10
1

I ended up solving the problem by installing the MacPorts package php5-sqlite (without the 3). Then it still didn't work. Then I reinstalled the MacPorts php5 package using +sqlite. Then everything worked. So, that's:

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

I hope that'll help anyone who stumbles onto this...

Robert Martin
  • 16,759
  • 15
  • 61
  • 87
0
$ sudo port install php5-sqlite
$ sudo apachectl -k restart

Works like a charm

talal7860
  • 405
  • 6
  • 9
0

Apple's pre-built PHP is rather limited, to say the least. They've added more stuff in versions in Snow Leopard and Lion, but it still lacks various features. As far as library version numbers go, those get updated with OS Point releases from Apple. As Leopard is now two generations behind the current, I wouldn't expect Apple to be providing more than security fixes for it at this point.

You could install a third-party of PHP such as the Entropy or Liip releases. The former isn't maintained anymore but I know it works with Leopard. The latter is more up to date, but I don't know what its Leopard compatibility status is.

Failing that, you'll have to download the PHP source and start building extensions yourself. For this you'll need to install XCode, which should be on the Leopard install disc. This method is extremely fiddly and difficult, however, and is only recommended for advanced users.

GordonM
  • 31,179
  • 15
  • 87
  • 129
  • I have xcode installed. I'm not using built-in PHP, I'm using the MacPorts php5... Is there an inherent problem with this method? – Robert Martin Aug 25 '11 at 17:46
  • Not if you're confident with doing it yourself. But if you want a version of the library other than the one that comes with macports, then you'll have to download the source and build it yourself, or wait for macports to update. – GordonM Aug 25 '11 at 21:09