使用自制软件在 MAC 上使用 Postgresql 安装 PHP

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29706027/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 01:52:12  来源:igfitidea点击:

Install PHP with Postgresql on MAC using homebrew

phpmacospostgresqlhomebrew

提问by M0rkHaV

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

我正在尝试使用本教程使用自制软件安装带有 Postgresql 的 PHP 5.6 。

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

但是,由于我不想使用 mysql 和 apache,因此在安装 php 5.6 时我使用以下命令:

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 :

但是,我没有安装 postgres 支持。我看到的第一行是所有的时间:

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

But nothing regarding --with-pgsql.

但没有关于--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.

当我尝试不指定指向我的 postgres 应用程序的链接时,它告诉我它找不到 pg_config。它还告诉我 --with-pgsql 已被弃用,我必须使用 --with-postgresql 但最终,它没有改变任何东西。

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

任何人都知道会发生什么?

回答by M0rkHaV

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 :

我找到了解决问题的方法。我用自制软件安装了 postgresql(即使它已经安装在我的电脑上),然后使用以下命令行安装了 php5.6:

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

Then I uninstall postgresql with homebrew

然后我用自制软件卸载 postgresql

brew uninstall postgresql

And finally I installed php5.6 pdo-pgsql

最后我安装了 php5.6 pdo-pgsql

brew install php56-pdo-pgsql

Hope it will help !

希望它会有所帮助!