带有 wamp 的 PostgreSQL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5218692/
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-20 22:52:53  来源:igfitidea点击:

PostgreSQL with wamp

postgresqlwamp

提问by Francesco Nigro

I have installed WAMP 2.1 on Windows 7 with PHP-5.3.4 and Apache-2.2.17 but instead of MySQL I'm using PostgreSQL version 8.4.

我已经使用 PHP-5.3.4 和 Apache-2.2.17 在 Windows 7 上安装了 WAMP 2.1,但我使用的是 PostgreSQL 8.4 版而不是 MySQL。

How can configure PostgreSQL on WAMP?

如何在 WAMP 上配置 PostgreSQL?

回答by Francesco Nigro

I have solved the problem by

我已经解决了这个问题

  • adding php_pgsqland php_pdo_pgsqlextensions
  • adding path-phpin PATHenvironment variable of Windows
  • 添加php_pgsqlphp_pdo_pgsql扩展
  • path-phpPATH的Windows环境变量

回答by Yu Guo

  1. Install PostgreSQL

  2. Edit php.ini, uncomment “extension=php_pgsql.dll”. Check both the php.ini in the PHP folder and Apache folder

  3. Edit environment variables, add PostgreSQL /bin and /lib directories to Path. This solves the issue of php_pgsql.dll not loading due to it not being able to resolve dependencies.

  4. Done. PHP should now be able to communicate with PostgreSQL.

  1. 安装 PostgreSQL

  2. 编辑 php.ini,取消注释“extension=php_pgsql.dll”。检查PHP文件夹和Apache文件夹中的php.ini

  3. 编辑环境变量,将PostgreSQL /bin 和/lib 目录添加到Path。这解决了 php_pgsql.dll 由于无法解决依赖关系而无法加载的问题。

  4. 完毕。PHP 现在应该能够与 PostgreSQL 通信。

回答by rilut

Don't forget that WAMP has two php.inifiles. One in Apache directory, one in php directory (bin\php\php5.X.X). Wampserver Tray manages the one in Apache directory.

不要忘记 WAMP 有两个php.ini文件。一份在 Apache 目录中,一份在 php 目录 ( bin\php\php5.X.X) 中。Wampserver Tray 管理 Apache 目录中的一个。

To be able to run php cli tools (e.g php artisan), you need to uncomment the php_pgsqland php_pdo_pgsqlin the php.iniin php directory.

为了能够运行PHP的CLI工具(如php artisan),则需要取消注释php_pgsql,并php_pdo_pgsqlphp.ini在PHP目录。

回答by Mathieu

What you are looking for is WAPP. It's a package similar to WAMP but with PostgreSQL instead of MySQL (and PhpPgAdmin instead of PhpMyAdmin)

您正在寻找的是WAPP。这是一个类似于 WAMP 的包,但使用 PostgreSQL 而不是 MySQL(和 PhpPgAdmin 而不是 PhpMyAdmin)

回答by Imran Nababan

The Best Way is add location of PHP Instalation to Environment Path of Windows

最好的方法是将 PHP 安装的位置添加到 Windows 的环境路径中

Control Panel -> System And Security -> System -> Advanced System Settings -> Environment Variables. Under "System Variables" add PHP Installation Dir for "Path" Variables.

控制面板 -> 系统和安全 -> 系统 -> 高级系统设置 -> 环境变量。在“系统变量”下为“路径”变量添加 PHP 安装目录。

Then Restart Apache Web Service This way is work for me (Windows 7 32 Bit, Apache 2.2, PHP 5.4)

然后重新启动 Apache Web 服务这种方式对我有用(Windows 7 32 位,Apache 2.2,PHP 5.4)