xammp 中的 Postgresql、phpPgAdmin [英] Postgresql, phpPgAdmin in xammp
问题描述
我在尝试启动 phpPgAdmin 时遇到此错误:
Hi I have this error while I'm trying to launch phpPgAdmin:
您的 PHP 安装不支持 PostgreSQL.您需要使用 --with-pgsql 配置选项重新编译 PHP.
Your PHP installation does not support PostgreSQL. You need to recompile PHP using the --with-pgsql configure option.
我使用的是 XAMPP 1.7.7 版、Postgresql 9.2.4 64 位和 phpPgAdmin 5.1.
I'm using XAMPP ver 1.7.7, Postgresql 9.2.4 64 bit, and phpPgAdmin 5.1.
我已经做了以下事情:
- 打开
C:\xampp\phpPgAdmin\conf\
中的config.inc.php
并将extra_login_security
设置为false
- Open
config.inc.php
found inC:\xampp\phpPgAdmin\conf\
and setextra_login_security
tofalse
$conf['extra_login_security'] = false;
- 在
C:\xampp\php\
中找到php.ini
文件,然后查找行;扩展名 = php_pgsql.dll
.去掉标签;
,这样结果是extension = php_pgsql.dll
.
- Find
php.ini
file inC:\xampp\php\
, then look for the line; extension = php_pgsql.dll
. Remove tag;
, so that the result wasextension = php_pgsql.dll
.
(虽然我找到了 php.ini- production 和 development 所以我取消了它们的注释)
(although I found php.ini- production and development so I uncomment them both)
- 打开
C:\xampp\apache\conf\extra\httpd-xampp.conf
并在
部分添加
- Open
C:\xampp\apache\conf\extra\httpd-xampp.conf
and in section<IfModule mime_module>
add
Alias /phppgadmin "c:/xampp/phpPgAdmin/"
<Directory "c:/xampp/phpPgAdmin">
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
- 加载文件C:/xammp/php/libpq.dll"
但我仍然收到此错误.有人可以帮我吗?
but I still get this error. Can someone help me?
推荐答案
我从头开始写答案,并非您尝试的所有方法都是错误的.
I am writing the answer from the beginning, not everything what you tried was wrong.
xampp 已启动并正在运行.
xampp is up and running.
下载phpPgAdmin并复制到c:\xampp\phpPgAdmin
Download phpPgAdmin and copy it into c:\xampp\phpPgAdmin
修改配置文件
C:\xampp\apache\conf\extra\httpd-xampp.conf
C:\xampp\apache\conf\extra\httpd-xampp.conf
像phpMyAdmin一样添加phpPgAdmin部分:
Add like phpMyAdmin part the phpPgAdmin part:
Alias /phppgadmin "C:/xampp/phpPgAdmin/"
<Directory "C:/xampp/phpPgAdmin">
AllowOverride AuthConfig
Require all granted
</Directory>
重启apache并进入浏览器
Restart apache and enter in browser
http://127.0.0.1/phppgadmin/
现在您将收到消息:使用 --pqsql 选项安装 php
Now you would get the message: install php with –-pqsql option
Postgres 的安装和配置:
Postgres installation and the configuration:
即使你有 64 位的 windows 也要安装 postgresql 32 位(这不是开玩笑)
Install postgresql 32bit even if you have 64bit windows (this is not a joke)
Postgres 现已启动并运行
Postgres is now up and running
再次修改配置文件
C:\xampp\apache\conf\extra\httpd-xampp.conf
C:\xampp\apache\conf\extra\httpd-xampp.conf
添加以下行(在我的例子中 PostgreSQL 安装在 C:/xampp/PostgreSQL 中):
Add the following line (in my case PostgreSQL is installed in C:/xampp/PostgreSQL):
LoadFile "C:/xampp/PostgreSQL/bin/libpq.dll"
在以下现有行之前
LoadFile "C:/xampp/php/php5ts.dll"
LoadModule php5_module "C:/xampp/php/php5apache2_4.dll"
修改配置文件
C:\xampp\php\php.ini
C:\xampp\php\php.ini
通过删除;"取消注释以下行
Uncomment the following line by removing ';'
;extension=php_pgsql.dll
重启apache并在浏览器中再次输入
Restart apache and enter again in your browser
http://127.0.0.1/phppgadmin/
它应该有效,对我有效
这篇关于xammp 中的 Postgresql、phpPgAdmin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!