Hi!

Recently I have installed a new server at home for learning reasons. No web server etc. were installed, so I downloaded the apache1.3.14 the php4.0.3pl1 and the postgresql7.0.2 sources.
I unpacked the sources and then tried to configure php with command: ./configure --with-apache=/usr/src/apache-1.3.14 --with-pgsql=/usr/src/postgresql-7.0.2 --enable...
That seemed to work.
Then I tried make. But after a few minutes it interrupted with Error code 1. It said that "postgres.h" (and two other headers) - "No such file or directory".
I find these headers correctly in the postgresql/src/include directory.
What may be the problem.

Thanks to everyone for solutions

    What operating system?

      Debian 2.2rev0

      Tonight I'll try to download and install an earlier version. I'll be happy if it works, but there are many bugfixes in this version, so the pl1 would be better.

        Now I tried to compile a 4.0.2 version.

        First I configured it: ./configure -with-apache=/usr/src/apache_1.3.14 -with-pgsql=/usr/src/postgresql-7.0.2 -enable-safe-mode -enable-force-cgi-redirect
        Then I executed make. These were the errors:

        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
        make[3]: [pgsql.lo] Error 1
        make[3]: Leaving directory '/usr/src/php-4.0.2/ext/pgsql'
        make[2]:
        [all-recursive] Error 1
        make[2]: Leaving directory '/usr/src/php-4.0.2/ext/pgsql'
        make[1]: [all-recursive] Error 1
        make[1]: Leaving directory '/usr/src/php-4.0.2/ext'
        make:
        [all-recursive] Error 1

        I searched for these files. The postgres.h is in the /usr/src/postgresql-7.0.2/src/include directory the libpq-fs.h is in the /usr/src/postgresql-7.0.2/src/include/libpq directory, but now I see that there's no libpq-fe.h

        What now. Maybe somebody could help, who succeed in compiling php with these parameters

        Thanks

          Doesn't Debian have PHP 4.0.3pl1 packages with PostgreSQL support?

            This is interesting. Just yesterday I was installing PHP/MySQL/Apache/SSL on a new box and when it came time to compile Apache I got the same type of error. Is this an Apache bug or a PHP bug?

              I don't think, because the error message comes up at the compiling of the postgres section (Yesterday I also tried to compile the postgres source only, but it didn't work, however I only did it with ./configure. It came back with linking errors). Although I wonder on the error message of yours. Why dous your system search for postgres headers if you try to compile it for mysql support???

              Dear Troels!
              I had a look on dselect this morning. There is a php with postgres support in the potato package, but it is version 4.0beta3. This was released on 16th november last year (1999). This might be a bit old at this time.
              After installing I'll try to make an on-line forum just like this here, but with other capabilities. So it should be built on very stable system.

              Thanks anyway

                Sorry.. i guess I didn't make myself clear. I didn't get the SAME error, i got the SAME TYPE of error. I am compiling with MySQL not postgreSQL. Anywaym the error is happening at the apache compile time, not at the PHP compile time.

                  David, from the ./configure --help output:

                  --with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL base install directory, defaults to /usr/local/pgsql.

                  Note that this is NOT the source directory, but the destination directory.

                  Further, if you installed postgres to the default directory, you can just use the --with-pgsql switch.

                    Thanks to this little piece of advice. You're rigth, it is the postgres directory.
                    So I installed the postgres from the debian CD. The current postgres directory is /usr/lib/postgres. Then I configured php with option --with-pgsql=/usr/lib/postgres, after that I did make, but the same error messages came up. I think that make seraches for these headers in the /usr/src/ext/pgsql directory.

                    Maybe I'll contact the support at the official php site.

                      Hi David

                      I just ran into the same problem, using :

                      PostgreSQL 7.0.2 (Mandrake RPM)
                      PHP 4.0.3pl1

                      I found the postgresql-devel RPM (rpmfind.net), installed it and that's all it took.

                      Thereafter, compile PHP with "--with-pgsql" - no [DIR} specified.

                      100% perfect ! :-)

                      Wayne

                        Oops, as per my previous post...configure works but make fails.....

                        After installing postgresql-devel, you need to ensure that the PHP config process can find the files in /usr/include/pgsql/*

                        I did a quick & nasty with :

                        "cp -r /usr/include/pgsql /tmp/php4-src/ext/"

                        where "php4-src" is the direcotry containing the php4 source files.

                        Happy PHPing

                        Wayne de Villiers

                          Also, be on the lookout for ./configure settings that fail silently. There's quite a few that will answer no automatically and silently go on, not configuring that option.

                          It's bit me on several occasions. Do a './configure --500-options-go-here |tee >log_file'
                          then a 'grep pgsql log_file' to see if it really get's configured.

                            4 months later

                            Just wondering if anyone have a solution for this error yet? I installed apache+php+mysql and have no problem. But when trying to compile php with-pgsql make died. I even tried different version of pgsql all the way back to 7.0.1x still no go =[

                            here's the configure I used:

                            ./configure --with-apache=../apache-1.19 --with-pgsql=/usr/local/pgsql

                            configure has no problem, it's make that died 🙁

                              After a few quiet moment - it occured to me. PostgreSQL is compiled with "gmake", PHP is instructed to use "make." I turned out this is a problem.

                              compile and install PostgreSQL as instructed, next run your PHP configure as usual. But instead of using "make" use "gmake" instead, next use "gmake install" - voila! problem solved!

                              I hope this will get documented in the future.

                                3 months later

                                Thanks.
                                That worked for me (Red Hat 7.0).
                                I tried gmake and gmake install and got the same error (reply to the one of the previous messages)

                                  Write a Reply...