带有 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
PostgreSQL with wamp
提问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_pgsql
andphp_pdo_pgsql
extensions - adding
path-php
inPATH
environment variable of Windows
- 添加
php_pgsql
和php_pdo_pgsql
扩展 - 加
path-php
在PATH
的Windows环境变量
回答by Yu Guo
Install PostgreSQL
Edit php.ini, uncomment “extension=php_pgsql.dll”. Check both the php.ini in the PHP folder and Apache folder
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.
Done. PHP should now be able to communicate with PostgreSQL.
安装 PostgreSQL
编辑 php.ini,取消注释“extension=php_pgsql.dll”。检查PHP文件夹和Apache文件夹中的php.ini
编辑环境变量,将PostgreSQL /bin 和/lib 目录添加到Path。这解决了 php_pgsql.dll 由于无法解决依赖关系而无法加载的问题。
完毕。PHP 现在应该能够与 PostgreSQL 通信。
回答by rilut
Don't forget that WAMP has two php.ini
files. 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_pgsql
and php_pdo_pgsql
in the php.ini
in php directory.
为了能够运行PHP的CLI工具(如php artisan
),则需要取消注释php_pgsql
,并php_pdo_pgsql
在php.ini
在PHP目录。
回答by Mathieu
回答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)