由于apache2和php5已经安装好,网上也有很多windows下apache2和php5的安装方法,就略过不表了,只紧要说一下postgreSQL 8.4在windows xp下下面的安装
1.下载PostgreSQL windows的安装版本 下载地址 http://www.enterprisedb.com/products/download.do

可能需要你登记一下,填写真实email 需要通过验证
2.下载好后运行postgresql-8.4.1-1-windows.exe程序 需要注意的是有一步选择本地语言字符 选 chinese,singapore
3.因为已经安装好了apache2和php5,因此finish那步不需要点选 "Launch Stack Builder at exit" 前面的按钮了 直接完成
可能会提示错误error reading c:\Program Files\PostgreSQL.3\data\postgresql.conf 这个不打紧 后面完成
执行下列步骤前,暂作以下假定:
PostgreSQL拟装在D:\software\PostgreSQL\
数据库以后拟存放在D:\software\PostgreSQL\data
安装好PostgreSQL,初始化数据库,将PostgreSQL注册为服务。
1新开一个cmd窗口,并切换目录: cd D:\software\PostgreSQL\bin ;
2.initdb -D D:\software\PostgreSQL.4\data -E UTF8 --locale=C
3、pg_ctl register -D D:\software\PostgreSQL.4\data -Npgsql 即将postgres注册为服务,服务名为pgsql;
以下为可选步骤了:
4、net start pgsql即可启动postgresql,进行后续工作了;
5、createdb -E UTF8 testdb,创建测试数据库
6、psql testdb 进入交互方式,直接操作数据库;
另上述第2步及5步为避免以后可能发生的亚州大字符集的乱码问题,统一使用UTF8。
在apache2中加入如下语句
Loadfile "d:/software/php5/libpq.dll" (参考php安装目录)
重新启动apache2
检测postgrestsql 8.4是否安装成功可以通过phpinfo()查看是否有pgsql
php中的测试postgreSQL连接是否成功的程序 下载 http://www.dayanmei.com/download.php?filename=pgsql.php.rar
<?php
error_reporting(E_ALL);
$url = $db_url = 'mysql://Administrator:password@localhost/postgres';
$url = parse_url($url);
$conn_string = '';
// Decode url-encoded information in the db connection string
if (isset($url['user'])) {
$conn_string .= ' user='. urldecode($url['user']);
}
if (isset($url['pass'])) {
$conn_string .= ' password='. urldecode($url['pass']);
}
if (isset($url['host'])) {
$conn_string .= ' host='. urldecode($url['host']);
}
if (isset($url['path'])) {
$conn_string .= ' dbname='. substr(urldecode($url['path']), 1);
}
$url['port'] = 5432;
if (isset($url['port'])) {
$conn_string .= ' port='. urldecode($url['port']);
}
$connection = pg_connect($conn_string);
if (!$connection) {
print '0';
}else{
print '1';
}
?>
收藏winxp下postgreSQL 8.4 apache2 php5.2的安装记录到百度搜藏

(142)
(131)
(311)
(236)
(70)
(24)
(6)
(162)
(44)
(24)
(24)
(6)
(2)
(3)
(16)
(11)
(3)