How do I enable Sqlite3 in OS X 10.5.8 with PHP?

前端 未结 4 1202
盖世英雄少女心
盖世英雄少女心 2021-01-24 12:40

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 extensio

相关标签:
4条回答
  • 2021-01-24 13:03

    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.

    • http://php-osx.liip.ch/
    • http://www.entropy.ch/

    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.

    0 讨论(0)
  • 2021-01-24 13:10

    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...

    0 讨论(0)
  • 2021-01-24 13:21
    $ sudo port install php5-sqlite
    $ sudo apachectl -k restart
    

    Works like a charm

    0 讨论(0)
  • 2021-01-24 13:22

    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

    0 讨论(0)
提交回复
热议问题