3

I am trying to install PHP 5.6 with Postgresql using homebrew using this tutorial.

However, as I do not want to use mysql and apache, when installing php 5.6 I use this command :

brew install php56 --without-mysql --without-apache --with-pgsql=/Applications/Postgres.app/Contents/Versions/9.4/bin/

However, I does not install postgres support. The first line I see is all the time :

==> Installing php56 with --without-mysql, --without-apache

But nothing regarding --with-pgsql.

When I try not to specify the link towards my postgres app, it tells me it cannot find pg_config. It also told me that --with-pgsql is deprecated and that I have to use --with-postgresql but in the end, it does not change anything.

As anyone any idea of what could go be going on ?

M0rkHaV
  • 432
  • 1
  • 4
  • 16
  • 1
    Is postgresql installed on your mac? You should install it independently, run it, then add in the php postgresql PDO driver after. Check out http://stackoverflow.com/questions/6588174/enabling-postgresql-support-in-php-on-mac-os-x as well. – Digits Apr 17 '15 at 17:43
  • Yes it is.. However, as it is installed with Postgres.app, I have to link to it in the brew install command (thus the --with-pgsql=/Applications/...) Thank you for the link, however, if I wanted to compile the sources I would have already used it .. I prefer to use brew not to deal with the depedency and all. – M0rkHaV Apr 17 '15 at 18:10

1 Answers1

11

I found a way to fix the problem. I installed postgresql with homebrew (even if it was already installed on my computer), then installed php5.6 with the following command line :

brew install php56 --without-mysql --without-apache --with-postgresql

Then I uninstall postgresql with homebrew

brew uninstall postgresql

And finally I installed php5.6 pdo-pgsql

brew install php56-pdo-pgsql

Hope it will help !

Karl Adler
  • 15,780
  • 10
  • 70
  • 88
M0rkHaV
  • 432
  • 1
  • 4
  • 16
  • Then make sure to restart php and your webserver as needed. Eg brew services php56 restart; brew services httpd22 restart. Had me stumped there for a little while.... – Dom Dec 26 '16 at 00:18