php链接pgsql,PHP不能使用PGSQL解决办法

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.

源文档

这是网上的解决方案

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

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

如图修改:

bfb50ce8985555d88a200b1537a7d8b7.png

config.inc.php文件在C:\WAMP\SCRIPTS\目录下,如图:

29e9b50505edf4aaaad80ce09b08652f.png

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

加载成功

这里libpg.dll文件用wamper安装后在php的安装目录就有匹配的版本,不要去下载了,直接复制过去!

测试一下

echo extension_loaded('pgsql');

输出为1则加载成功了!

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

---------------------

作者:casey_chen  来源:CSDN  原文:https://blog.csdn.net/hainan89/article/details/6023342

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值