# 加载postgres模块后apache无法启动

- URL: https://wuming.si/blog/1076/
- Author: Aaron
- Published: 2015-11-14
- Language: zh-Hans
- Categories: Technology
- Originally published at: https://blog.wo.ai/archives/1076

想在本地搭建一个PostgreSQL的运行环境，完成之后，始终在apache/php环境无法加载postgresql模块。启动的时候无法加载libpq.dll，将postgresql的libpq拷贝到php目录无效，拷贝到windows目录无效，拷贝到windows\system32目录也无效，只好在网上找解决方法。搜到以下方法：

refering to the libpq.dll that comes bundled with PHP, like this:

LoadFile “C:/php/libpq.dll”

(原文地址：http://stackoverflow.com/questions/551734/php-not-loading-php-pgsql-dll-on-windows)

在http.conf文件中增加这一行，完美解决。其实这个答案之前有混淆的问题，比如加载pg目录的libpq.dll，似乎无效,只能用php目录里面自带的libpq.dll。
