在windows下解决wamper加载pgsql的问题/配置方法

 

> Copy 'libpq.dll' to the 

> Apache bin directory from the PHP directory 

> (/bin/php/ ). The reason for this is because PHP 

> is loaded as an Apache module, so any dlls that 

> the extensions require need to be copied to the 

> Apache bin directory. 

> 

> 1. Open 'config.inc.php' in any text editor. 

> 2. Do a search for '$phpDllToCopy' without the 

> single quotes. 

> 3. Add the following at the end of the line that 

> was found in step 2, exactly as written: 

> 'libpq.dll', 

> --- The edited line should look like the 

> following: $phpDllToCopy = array ( 'libpq.dll', 

> 4. Save 'config.inc.php' and refresh WampServer. 

 

源文档 <http://www.wampserver.com/phorum/read.php?2,40270,40311>

 

这是网上的解决方案

 

首先将php目录下的libpq.dll文件复制到apachebin目录下

 

然后修改config.inc.php的文件在$phpDllToCopy数组中加入libpq.dll这一项

 

重启后人就没有将pgsql模块加载成功!

 

于是再将libpg.dll文件复制到系统盘的windows/system32目录下重新启动wamper

 

加载成功

 

这里libpg.dll文件是8.3的版本,之前在网上下载了一个7点几的版本不行,

 

原来用wamper安装后在php的安装目录就有匹配的版本了不要去下载了,直接复制过去!

 

测试一下

 

echo extension_loaded('pgsql');

 

输出为1则加载成功了!

 

注: 如果还不行则检查一下确认php.ini文件是否启用了postgresql这一项,将:extension=php_pgsql.dll前面的引号去掉!在试试!

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Hainan Chen

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值