Thread: PHP and PostgresSQL beta

PHP and PostgresSQL beta

From
ryan@paymentalliance.net
Date:
I know this issue has been discussed, currently I can't find the
resolution.  What needs to be done to the latest php release to get it
to successfully compile with the latest beta version of pgsql?

Below is the error I get when compiling php -

make[2]: Entering directory `/usr/local/etc/php-4.0.4pl1/ext/pgsql'
make[3]: Entering directory `/usr/local/etc/php-4.0.4pl1/ext/pgsql'
gcc  -I. -I/usr/local/etc/php-4.0.4pl1/ext/pgsql
-I/usr/local/etc/php-4.0.4pl1/main -I/usr/local/etc/php-4.0.4pl1
-I/usr/local/etc/httpd/src/i
nclude -I/usr/local/etc/httpd/src/os/unix
-I/usr/local/etc/php-4.0.4pl1/Zend -I/usr/local/etc/mck331/c-api
-I/usr/local/mysql/include/mysql -I
/usr/local/etc/php-4.0.4pl1/ext/xml/expat/xmltok
-I/usr/local/etc/php-4.0.4pl1/ext/xml/expat/xmlparse
-I/usr/local/etc/php-4.0.4pl1/TSRM -I/us
r/local/pgsql/include -DXML_BYTE_ORDER=12 -g -O2  -c pgsql.c && touch
pgsql.lo
In file included from pgsql.c:29:
php_pgsql.h:32: postgres.h: No such file or directory
make[3]: *** [pgsql.lo] Error 1
make[3]: Leaving directory `/usr/local/etc/php-4.0.4pl1/ext/pgsql'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/etc/php-4.0.4pl1/ext/pgsql'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/etc/php-4.0.4pl1/ext'
make: *** [all-recursive] Error 1

Re: PHP and PostgresSQL beta

From
"Brett W. McCoy"
Date:
On Mon, 5 Mar 2001 ryan@paymentalliance.net wrote:

> I know this issue has been discussed, currently I can't find the
> resolution.  What needs to be done to the latest php release to get it
> to successfully compile with the latest beta version of pgsql?

It can't find the postgresql headers.  Did you install from RPM and not
install the devel RPM, or perhaps the headers aren't in a standard place?

-- Brett
                http://www.chapelperilous.net/~bmccoy/
------------------------------------------------------------------------
Good leaders being scarce, following yourself is allowed.



Re: PHP and PostgresSQL beta

From
"Martin A. Marques"
Date:
El Mar 06 Mar 2001 17:13, Brett W. McCoy escribió:
> On Mon, 5 Mar 2001 ryan@paymentalliance.net wrote:
> > I know this issue has been discussed, currently I can't find the
> > resolution.  What needs to be done to the latest php release to get it
> > to successfully compile with the latest beta version of pgsql?
>
> It can't find the postgresql headers.  Did you install from RPM and not
> install the devel RPM, or perhaps the headers aren't in a standard place?

This has been discussed on this list (or the hacker list), and the problem
has been fixxed on the cvs version of php.
The problem is that there is no more a postgres.h, but I can't remember
what's the new name of that header. Anyone remembers?

--
System Administration: It's a dirty job,
but someone told I had to do it.
-----------------------------------------------------------------
Martín Marqués            email:     martin@math.unl.edu.ar
Santa Fe - Argentina        http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------

Re: PHP and PostgresSQL beta

From
"Martin A. Marques"
Date:
El Mar 06 Mar 2001 17:48, Martin A. Marques escribió:
> El Mar 06 Mar 2001 17:13, Brett W. McCoy escribió:
> > On Mon, 5 Mar 2001 ryan@paymentalliance.net wrote:
> > > I know this issue has been discussed, currently I can't find the
> > > resolution.  What needs to be done to the latest php release to get it
> > > to successfully compile with the latest beta version of pgsql?
> >
> > It can't find the postgresql headers.  Did you install from RPM and not
> > install the devel RPM, or perhaps the headers aren't in a standard place?
>
> This has been discussed on this list (or the hacker list), and the problem
> has been fixxed on the cvs version of php.
> The problem is that there is no more a postgres.h, but I can't remember
> what's the new name of that header. Anyone remembers?

OK, found the post....


De: Larry Rosenman <ler@lerctr.org>
Para: PostgreSQL Hackers List <pgsql-hackers@postgresql.org>,
tgl@sss.pgh.pa.us, Peter Eisentraut <peter_e@gmx.net>, pgman@candle.phl.pa.us

OK, I found it.  PHP was including postgres.h (which we no longer
install...., so we were picking up a Feb 7 version).

Changing php's ext/pgsql/php_pgsql.h to #include <postgres_fe.h>
fixes it.

This is a gotcha for people following CVS or not cleaning out
the $(DESTDIR)/include directory

I'll submit a patch to the PHP folk.

--
System Administration: It's a dirty job,
but someone told I had to do it.
-----------------------------------------------------------------
Martín Marqués            email:     martin@math.unl.edu.ar
Santa Fe - Argentina        http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------

Re: PHP and PostgresSQL beta

From
Tom Lane
Date:
ryan@paymentalliance.net writes:
> I know this issue has been discussed, currently I can't find the
> resolution.  What needs to be done to the latest php release to get it
> to successfully compile with the latest beta version of pgsql?

Remove the #include "postgres.h" in php_pgsql.h.

            regards, tom lane