Re: Hello, etc. - Mailing list pgsql-php

From Adam Lang
Subject Re: Hello, etc.
Date
Msg-id 004101c039cc$7f9a3ca0$330a0a0a@6014cwpza006
Whole thread Raw
In response to Hello, etc.  ("Shaun Grannis" <granniss@msu.edu>)
List pgsql-php
www.php.net has information on compiling php and apache.

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
----- Original Message -----
From: "Shaun Grannis" <granniss@msu.edu>
To: <pgsql-php@postgresql.org>
Sent: Thursday, October 19, 2000 2:54 AM
Subject: Hello, etc.


> Hi,
>
> Would like to ask a few questions. I have been assigned the task of
> implementing a web front-end/database backend for a medical office. The
> office has 36,000 patients and 25 doctors. Is postgres a reliable
solution?
> (I see posts from people saying that from time to time they have to reset
> postgres due to connections timeouts, or other issues -- sorry I can't
> recall specifics right now.) I'd like to hear about some real-world
examples
> with specifics regarding the size of the database, reliability, and backup
> procedures.
>
> I'd like to implement an open source solution, and PHP/Postgres/Apache is
> very attractive (MySQL is excluded due to the lack of sub-selects). I used
> PHP/Postgres/Apache 2 years ago for a small medical database for 12 users
> and less than 1000 records. It worked well. I now return to the technology
> to implement the above-mentioned system.
>
> Perhaps I haven't looked hard enough, but I could not find a "How-to" on
> compiling PHP for postgres/apache. I would think this is a common
> combination, no? I'm going to post my ongoing experience with the process,
I
> find reading about others' experience educational. Based on the following
> experience, I'm going to create a howto for compiling php/apache/postgres
> from the tarballs. The RPM nonsense gets confusing, particularly with
> RedHat-derived versions putting their files in different directories from
> the standard install. (I'm on a Mandrake box right now)
>
> Here's my adventure so far:
>
> 1) download rpms for mandrake from postgres mirror (mars.capital-data.com)
>
> 2) rpm -qip mod_php3-pgsql-3.0.17RC1-2mdkPG7.1686.rpm:
> This is a dynamic shared object (DSO) for Apache that will add PostgreSQL
> database support to PHP3.  If you need back-end support for PostgreSQL,
> you should install this package in addition to the main mod_php3 package.
>
> 3) rpm -qip mod_php3-3.0.17RC1-2mdkPG7.i686.rpm:
> The mod_php module enables the Apache web server to
> understand and process the embedded PHP language in web pages.
> This package contains PHP3, or PHP version 3.0.17RC1.  If you use
> applications which specifically rely on PHP/FI, you should instead
> install the PHP/FI module contained in the mod_php package.
> If you're just starting with PHP, you should install this package.
> You'll also need to install the Apache web server.
>
> 4) attempt to install mod_php3-3.0.17RC1 with:
> rpm -i mod_php3-3.0.17RC1-2mdkPG7.i686.rpm
> WRONG ARCHITECTURE
>
> 5) Build my own
>
> 6) get source for php 4.0.2
>
> 7) tar xzvf php-4.0.2.tar.gz
>
> 8) sent email to Jouni Ahto, postgres extension maintainer "odd fixes",
> after read EXTENSIONS file. (will php postgres work?)
>
> 9) Began reading INSTALL file in distribution
>
> 10) pre INSTALL, ran "httpd -l" to make sure "mod_so.c" was present,
> indicating "mod_so" was enabled
>
> 11) per INSTALL, ran
> $ ./configure --with-postgres --with-apxs
>
> 12) lex or flex was not present -- downloaded flex for mandrake 7.1 and
> installed
>
> 13) again ran:
> $ ./configure --with-mysql --with-apxs
>
> ./configure: apxs: command not found
> configure: error: Sorry, I cannot run apxs. Either you need to install
Perl
> or you need to pass the
> absolute path of apxs by using --with-apxs=/absolute/path/to/apxs
>
> 14) could not locate apxs script, ran find /|grep apxs to see if it's on
the
> system anywhere
>
> 15) apxs man page was there, but no apxs script -- wierd
>
> 16) download apache source (sucks cuz i already have mandrake apache rpm
> installed) hope the apxs script is in the source code! took forever to
find
> a decent mirror.
>
> 17) unpack apache code: tar xzvf apache_1.3.12.tar.gz
>
> 18) found "apxs.pl" in apache dir ./src/support/apxs.pl
>
> 19) per php INSTALL file, ran this in the php-4.0.2 directory:
> $ ./configure --with-postgres --with-apxs=../apache_1.3.12/src/support/
>
> 20) ERROR! in the apache distrbution, the apxs script (a perl script) is
> named "apxs.pl" and the php script is looking for "apxs" -- so I rename
the
> apxs file . . .
>
> 21) i also noticed in my configure script output the following:
> configure: warning: You will need bison if you want to regenerate the PHP
> parsers.
>
> so i download and install bison for mandrake
>
> 22) apxs is renamed, and the following is run again:
> $ ./configure --with-postgres --with-apxs=../apache_1.3.12/src/support/
> same ERROR!
>
> 23) I see apxs.pl is not set to execute mode, so I delete apxs, and run
> "chmod +x apxs.pl" and rerun:
> $ ./configure --with-postgres --with-apxs=../apache_1.3.12/src/support/
>
> 24) copy apxs.pl file to apxs, and rerun . . . .
> $ ./configure --with-postgres --with-apxs=../apache_1.3.12/src/support/
> EROR!
>
> 25) I look at the apxs script, and it refers to perl in
/usr/local/bin/perl.
> On my mandrake system, perl is located at /usr/bin/perl, so I edit the
> script . . . and rerun
>
> 26) nothing's working. i see that autoconf is not installed, so i install
> it. (and find out that m4 is also needed)
>
> 27) maybe i need the postgres source, too! download that.
>
> 28) my root/download folder looks like:
> drwxr-xr-x    8 1078     1078         4096 Oct 11 00:46 apache_1.3.12/
> -rw-r--r--    1 root     root      1709589 Feb 25  2000
apache_1.3.12.tar.gz
> drwxrwxr-x   14 512      511          4096 Oct 11 01:27 php-4.0.2/
> -rw-r--r--    1 root     root      2088247 Oct 11 00:06 php-4.0.2.tar.gz
> drwxr-xr-x    5 1005     96           4096 Jun  5 14:15 postgresql-7.0.2/
> -rw-r--r--    1 root     root      2338356 Jun  5 14:17
> postgresql-7.0.2.base.tar.gz
> -rw-r--r--    1 root     root      2545529 Jun  5 14:16
> postgresql-7.0.2.docs.tar.gz
> -rw-r--r--    1 root     root      1322640 Jun  5 14:17
> postgresql-7.0.2.support.tar.gz
> -rw-r--r--    1 root     root      7211311 Jun  5 14:16
> postgresql-7.0.2.tar.gz
> -rw-r--r--    1 root     root      1006213 Jun  5 14:17
> postgresql-7.0.2.test.tar.gz
>
> 29) going back into the php-4.0.2/ directory: i now run
> $
>
./configure --with-postgres=../postgresql-7.0.2/ --with-apxs=../apache_1.3.1
> 2/src/support/
> NO GOOD!
>
> 30) let's try a diversion in to compiling postgres 7.0.2 . . . .
>
> 31) per INSTALL, create postgres superuser and passwd
>
> 32) ran config, had to install gcc-g++ for mandrake . . .
>
> 33) ran configure, then gmake . . .
>
> 34) followed the pgsql intructions and got postgres up and running -yay!
>
> 35) need to try to configure a static apache module, since dynamic (apxs)
is
> not working
>
> 36) entered configure command to make php with postgres and apache:
>
./configure --with-postgres --with-apache=../apache_1.3.12/ --enable-track-v
> ars
>
> 37) Get an error in the config script:
> configure: error: Invalid Apache directory - unable to find httpd.h under
> /root/download/apache_1.3.12/apache_1.3.12
>
> 38) look in configure script: things look OK
>
> 39) Try configure again, this time without trailing "/":
>
./configure --with-postgres --with-apache=../apache_1.3.12 --enable-track-va
> rs
>
> 40) This worked, but configures MySQL. I need to use the
> option --with-pgsql:
>
./configure --with-pgsql --with-apache=../apache_1.3.12 --enable-track-vars
>
> 41) It again tells me at the end of the configure script output that I've
> configured PHP for MySQL -- need to go to the Postgres maling list and see
> if anyone is having the same prob:
> | You chose to compile PHP with the built-in MySQL support.  If you  |
> | are compiling a server module, and intend to use other server      |
> | modules that also use MySQL                                        |
>
> 42) Started compiling anyway, but then decided to use the configure option
> "--without-mysql" to see if I can get rid of the mysql code. It worked!
>
> 43) Apache compiled according to the instructions. (It's huge!!! 2.4
MB+!!)
> However the apache binary looks for the config files on a different
> directory than where they are currently installed. (I had done just a
> standard mandrake rpm install of apache previously):
> $ apachectl start
> fopen: No such file or directory
> httpd: could not open document config file /www/conf/httpd.conf
> /usr/sbin/apachectl start: httpd could not be started
>
> =======================
>
> You guys get the picture.
>
> Take care,
>
> Shaun Grannis, MD
> Diplomat, American Board of Family Practice


pgsql-php by date:

Previous
From: "Justin Long"
Date:
Subject: Re: Hello, etc.
Next
From: "Adam Lang"
Date:
Subject: Re: Hello, etc.