Thread: problem compiling php for pgsql

problem compiling php for pgsql

From
dave
Date:
Hi,

Not sure which list this should go to, so I've posted to both.

I installed pgsql 7.02, from the RH RPMS, and got pgsql working OK. I
then went back to my php-4.0.1pl2 distribution which I'd had working
for a while to try and compile in pgsql.

tried --with-pgsql (also =/usr, =/usr/local, =/usr/local/pgsql)

On compiling php, each time I get

/bin/sh /usr/local/php-4.0.1pl2/libtool --silent --mode=compile gcc
-DHAVE_CONFIG_H -I. -I/usr/local/php-4.0.1pl2/ext/pgsql
-I/usr/local/php-4.0.1pl2 -I/usr/local/php-4.0.1pl2/main
-I/usr/local/apache/include -I/usr/local/php-4.0.1pl2/Zend
-I/usr/local/php-4.0.1pl2 -I/usr/local/php-4.0.1pl2/ext/mysql/libmysql
-I/usr/local/php-4.0.1pl2/ext/xml/expat/xmltok
-I/usr/local/php-4.0.1pl2/ext/xml/expat/xmlparse -I
-DXML_BYTE_ORDER=12 -g -O2  -c pgsql.c
In file included from pgsql.c:29:
php_pgsql.h:32: postgres.h: No such file or directory
php_pgsql.h:33: libpq-fe.h: No such file or directory
php_pgsql.h:39: libpq/libpq-fs.h: No such file or directory

So I went back to pgsql to look for these include files. I couldn't
find an RPM for them, so I installed postgresql-7.0.2-base source. I
did a make install-headers (am I on the wrong track yet). This
appeared to install the headers to /usr/local/pgsql/include, although
I noticed there was no

libpq-fe.h

My recompile of pgsql gave the same results (even for postgres.h). I
can't believe I'm going about this the right way.

Does anyone know what I should be doing? I'd like to try and keep this
as much RPM based as possible (i.e. I did think of downloading ALL
sources and compiling the lot, but I'd like to avoid that - I mean my
pgsql install works fine)

many thanks,
Dave

Re: problem compiling php for pgsql

From
Lamar Owen
Date:
dave wrote:
> Does anyone know what I should be doing? I'd like to try and keep this
> as much RPM based as possible (i.e. I did think of downloading ALL
> sources and compiling the lot, but I'd like to avoid that - I mean my
> pgsql install works fine)

In the RPM distribution of PostgreSQL, you need to point php to include
/usr/include/pgsql -- and the libs are in /usr/lib.  Or you can see the
RPM's of php distributed with RedHat 6.2 and see the configure switches
used in mod-php.spec (download the mod-php SRC rpm, rpm -i, cd to
/usr/src/redhat/SPECS, that's where you'll find it.).

For the reasons why the RPM is this way, see
/usr/doc/postgresql-7.0.2/README.rpm, or see
http://www.ramifordistat.net/postgres
--
Lamar Owen
RPM Package Maintainer, PostgreSQL Global Development Group
WGCR Internet Radio
1 Peter 4:11

Re: [PHP-INST] problem compiling php for pgsql

From
Jouni Ahto
Date:

On Sat, 29 Jul 2000, dave wrote:

> Hi,
>
> Not sure which list this should go to, so I've posted to both.
>
> I installed pgsql 7.02, from the RH RPMS, and got pgsql working OK. I
> then went back to my php-4.0.1pl2 distribution which I'd had working
> for a while to try and compile in pgsql.
>
> tried --with-pgsql (also =/usr, =/usr/local, =/usr/local/pgsql)
>
> On compiling php, each time I get
>
> /bin/sh /usr/local/php-4.0.1pl2/libtool --silent --mode=compile gcc
> -DHAVE_CONFIG_H -I. -I/usr/local/php-4.0.1pl2/ext/pgsql
> -I/usr/local/php-4.0.1pl2 -I/usr/local/php-4.0.1pl2/main
> -I/usr/local/apache/include -I/usr/local/php-4.0.1pl2/Zend
> -I/usr/local/php-4.0.1pl2 -I/usr/local/php-4.0.1pl2/ext/mysql/libmysql
> -I/usr/local/php-4.0.1pl2/ext/xml/expat/xmltok
> -I/usr/local/php-4.0.1pl2/ext/xml/expat/xmlparse -I
> -DXML_BYTE_ORDER=12 -g -O2  -c pgsql.c
> In file included from pgsql.c:29:
> php_pgsql.h:32: postgres.h: No such file or directory
> php_pgsql.h:33: libpq-fe.h: No such file or directory
> php_pgsql.h:39: libpq/libpq-fs.h: No such file or directory
>
> So I went back to pgsql to look for these include files. I couldn't
> find an RPM for them, so I installed postgresql-7.0.2-base source. I
> did a make install-headers (am I on the wrong track yet). This
> appeared to install the headers to /usr/local/pgsql/include, although
> I noticed there was no
>
> libpq-fe.h
>
> My recompile of pgsql gave the same results (even for postgres.h). I
> can't believe I'm going about this the right way.
>
> Does anyone know what I should be doing? I'd like to try and keep this
> as much RPM based as possible (i.e. I did think of downloading ALL
> sources and compiling the lot, but I'd like to avoid that - I mean my
> pgsql install works fine)

Either do a *full* install of PostgreSQL, not only headers, from sources
and remove all the RPM's, or, because you seem to prefer them, install
also postgresql-devel-7.0.2-2.i386.rpm, which I think is missing from your
system, remove /usr/local/pgsql, ./configure --with-pgsql=/usr and
recompile. Having bits of postgres installed from RPM's, other bits from
sources to another place is very likely to play havoc on PHP's configure
script.

-- Jouni Ahto



Re: [PHP-INST] problem compiling php for pgsql

From
dave
Date:
Jouni Ahto wrote:
>
> Either do a *full* install of PostgreSQL, not only headers, from sources
> and remove all the RPM's, or, because you seem to prefer them, install
> also postgresql-devel-7.0.2-2.i386.rpm, which I think is missing from your
> system, remove /usr/local/pgsql, ./configure --with-pgsql=/usr and
> recompile. Having bits of postgres installed from RPM's, other bits from
> sources to another place is very likely to play havoc on PHP's configure
> script.

Thanks, yes, it was the devel RPM I needed. Sorry, I should really
have spotted that - it was late!

Actually, given that the devel RPM puts includes in /usr/include,
which can then be used by seperate apps that interface with pgsql, is
there not an argument for including headers in the base or server RPM?
The devel RPM isn't the first thing that occurs when compiling a
different app.

(I'm sure there are good reasons!)

Thanks for your help.
Dave