1

I need to install a version of PHP that has been compiled to work with Postgres, unlike the default version that came with my Mac Leopard system. How can I do this without somehow disabling the httpd.conf and php.ini files or confusing the system due to having so many of them?

  • 2
    You could just compile the postgres module and load it into your existing PHP. – Marc B Oct 27 '11 at 21:19
  • See: [How to enable php extension using `phpize`?](http://stackoverflow.com/questions/6200994/how-to-enable-php-extension-using-phpize) – outis Oct 27 '11 at 21:24

2 Answers2

1

I used homebrew to do this:

brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/php.rb --with-mysql --with-intl --with-apxs2=/usr/sbin/apxs --enable-cli --enable-mbregex --with-pgsql

this shouldn't replace the existing php.ini file, but if you want to be careful, you can make a copy first. it doesn't affect httpd.conf

more detailed explanation

uncreative
  • 1,436
  • 9
  • 14
  • using brew worked for me. i had to disable the native apache server in order to use my brewed version, but no big deal. –  Nov 07 '11 at 15:16
0

MacPorts creates an entirely separate install tree for its packages:

sudo port install php5-postgresql

will install everything you need. Your php.ini, for example, will be in /opt/local/etc/php5/php.ini.

Get MacPorts from here: MacPorts

majelbstoat
  • 12,889
  • 4
  • 28
  • 26