pgsql扩展未加载 [英] pgsql extension is not loading

查看:83
本文介绍了pgsql扩展未加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows 10 64位(WAPP)上使用pgsql扩展.
我有:

I am trying to use pgsql extension on Windows 10 64-bit (WAPP).
I have:

  • 重新启动Apache
  • 取消注释 php.ini
  • 中的所有postgresql扩展
  • 使用 LoadFile 加载 pgsql.dll
  • pgsql.dll 移至Apache bin(我尝试了php文件夹和PostgreSQL中的dll)
  • restarted Apache
  • uncommented all postgresql extensions in php.ini
  • used LoadFile to load pgsql.dll
  • moved pgsql.dll to Apache bin (I tried both dll from php folder and from postgresql)

但仍然没有结果.
pgsql 仅在 php.exe -m 中可见,而在 phpinfo() extension_loaded() get_loaded_extensions().
我的php版本是 7.1.8 ,而PostgreSQL是 9.6 ,而Apache是​​ 2.4.27 .
我的 php.exe -m 输出:

可能是什么问题?

But still no result.
pgsql is visible only in php.exe -m but not in phpinfo(), extension_loaded(), get_loaded_extensions().
My php version is 7.1.8 and PostgreSQL is 9.6 and Apache is 2.4.27.
My php.exe -m output:

What can be the problem?

推荐答案

[已解决]

好的,看了几个小时,我发现了问题,并且能够解决phpinfo()中未显示的pdo_pgsql和pgsql模块的问题.

Okay, after a few hours of looking, I found the problem and was able to solve the problem with the pdo_pgsql and pgsql modules not showing in phpinfo().

[解决方案]

取消注释php.ini中的扩展名后,进入httpd.conf并在所有LoadModule行的顶部添加以下内容:

After uncommenting the extensions in php.ini, go into httpd.conf and add at the top of all the LoadModule lines the following:

LoadFile"C:/Program Files/PostgreSQL/9.6/bin/libpq.dll"

LoadFile "C:/Program Files/PostgreSQL/9.6/bin/libpq.dll"

(假设您使用的是最新版本的PostgreSQL,否则将数字更改为您使用的版本).

(assuming you are using the latest version of PostgreSQL, otherwise change the number to the version you are using).

保存并重新启动Apache.转到phpinfo(),您将看到它已加载.

Save and restart Apache. Go to phpinfo() and you will see it is loaded.

[原因]

即使将Apachepg.dll复制到Apache/bin文件夹中,它也无法看到libpg.dll.

Apache is unable to see the libpg.dll even if you copy it into the Apache/bin folder.

[环境]

  • Windows Server 2016(也适用于Windows 10)
  • Apache 2.4.26
  • (x64)PHP 7.1.8(x64 ThreadSafe VC14)
  • PostgreSQL 9.6.4(x64)

这篇关于pgsql扩展未加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆