You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Graf László <gr...@datatrans.hu> on 2009/02/22 21:40:57 UTC

Using PostgreSQL in Apache2 module

Hi,

I try to use PostgreSQL's libpq in an Apache2 module.
The test module, without libpq works fine and the test
application for libpq works fine, too.

I put the libpq code lines in my module and it compiles
fine, without errors.

But after restarting the Apache2 server it complains
that it does not find the module. The new version of the
test module is in the APACHE_HOME\modules folder and the
httpd.conf is OK.

I put the folders POSTGRESQL_HOME\include and POSTGRESQL_HOME\lib
in my system's PATH but without results.

What is wrong? Can somebody help me?


Laci

Re: Using PostgreSQL in Apache2 module

Posted by Nick Kew <ni...@apache.org>.
On Sun, 22 Feb 2009 21:40:57 +0100
Graf László <gr...@datatrans.hu> wrote:

[hmm, looks like my last reply got lost in the ether]

> Hi,
> 
> I try to use PostgreSQL's libpq in an Apache2 module.
> The test module, without libpq works fine and the test
> application for libpq works fine, too.  

Is there a good reason for using libpq directly,
rather than the Apache DBD functions?  Other things
being equal, your module will be more efficient and
play better with other PostgreSQL-using modules if
it shares a dynamic connection pool with them.

> But after restarting the Apache2 server it complains
> that it does not find the module. The new version of the
> test module is in the APACHE_HOME\modules folder and the
> httpd.conf is OK.  

Erm, that's too vague.

> I put the folders POSTGRESQL_HOME\include and POSTGRESQL_HOME\lib
> in my system's PATH but without results.  

Maybe you need to LoadFile libpq?

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

RE: Using PostgreSQL in Apache2 module

Posted by Curt Krone <cu...@autodesk.com>.
Are you running on Windows by any chance?  I recently tried to use PostgreSQL to store auth info, and discovered that libpq.dll had a dependency on msvcr80.dll.  Once I had the PostgreSQL bin and lib directories as well as msvcr80.dll in my PATH everything worked.

Hope that helps,

curt

-----Original Message-----
From: Graf László [mailto:grafl@datatrans.hu]
Sent: Sunday, February 22, 2009 12:41 PM
To: modules-dev@httpd.apache.org
Subject: Using PostgreSQL in Apache2 module

Hi,

I try to use PostgreSQL's libpq in an Apache2 module.
The test module, without libpq works fine and the test
application for libpq works fine, too.

I put the libpq code lines in my module and it compiles
fine, without errors.

But after restarting the Apache2 server it complains
that it does not find the module. The new version of the
test module is in the APACHE_HOME\modules folder and the
httpd.conf is OK.

I put the folders POSTGRESQL_HOME\include and POSTGRESQL_HOME\lib
in my system's PATH but without results.

What is wrong? Can somebody help me?


Laci