LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Quick question about compiling PHP with PostgreSQL support (https://www.linuxquestions.org/questions/linux-server-73/quick-question-about-compiling-php-with-postgresql-support-535866/)

JellyStones 03-08-2007 10:38 PM

Quick question about compiling PHP with PostgreSQL support
 
The PHP.net webpage states

"In order to enable PostgreSQL support, --with-pgsql[=DIR] is required when you compile PHP. DIR is the PostgreSQL base install directory, defaults to /usr/local/pgsql."

The only problem is that I can't find where my PostgreSQL base install directory is. It was installed as a package with Debians package manager (apt-get). When I do a "find" for postgres, or psql or pgsql, the files are scattered all over the place.

I understand that if I had compiled from source, the base install directory would be "/usr/local/pgsql"

/usr/bin/psql allows me to connect to the database. Should I point to here?

Can someone please point me in the right direction?

fukawi2 03-09-2007 03:54 AM

Is there a /usr/local/pgsql directory? If so, use that...

JellyStones 03-09-2007 06:39 AM

Quote:

Originally Posted by fukawi2
Is there a /usr/local/pgsql directory? If so, use that...

Unfortunately no.


frost:/usr/local# ls
apache2 bin games include lib man php sbin share src

Here are the results of locate and find


frost:/usr/local# locate pgsql
/usr/lib/postgresql/lib/plpgsql.so
/usr/local/php/include/php/ext/pgsql
/usr/local/php/include/php/ext/pgsql/php_pgsql.h
/var/cache/apt/archives/php4-pgsql_3%3a4.3.9-1_i386.deb
/var/lib/dpkg/info/php4-pgsql.list
/var/lib/dpkg/info/php4-pgsql.postrm

frost:/usr/local# find / -name pgsql
/usr/local/php/include/php/ext/pgsql
/martin/php-4.4.6/ext/pgsql

fukawi2 03-09-2007 07:42 AM

Looking at my PostgreSQL installation (to /usr/local/pg-8.2/ ) from source, the file plpgsql.so is in /usr/local/pg-8.2/lib/postgresql/ so I'd be guessing you want to use /usr/lib/postgresql/lib/ as your directory... That's the only file I could find in common with your 'locate' output :)

JellyStones 03-09-2007 04:16 PM

Quote:

Originally Posted by fukawi2
Looking at my PostgreSQL installation (to /usr/local/pg-8.2/ ) from source, the file plpgsql.so is in /usr/local/pg-8.2/lib/postgresql/ so I'd be guessing you want to use /usr/lib/postgresql/lib/ as your directory... That's the only file I could find in common with your 'locate' output :)


It looks like the packaged versions of PostgreSQL in Debian fail to come with pg_config. PHP needs this file because pg_config gives information about the postgresql install.

Anyway, looks like I will have to install PostgreSQL from source.

Thanks anyway.

Martin

Tinkster 03-14-2007 04:10 AM

Which packages *did* you install? Mine on etch does have pg_config,
and it has the headers, too. That said, there's a PHP postgres
package available as well.
Code:

apt-cache search php | grep -i postgr
php4-pgsql - PostgreSQL module for php4
php5-pgsql - PostgreSQL module for php5
phppgadmin - Set of PHP scripts to administrate PostgreSQL over the WWW



Cheers,
Tink

JellyStones 03-14-2007 04:20 PM

Quote:

Originally Posted by Tinkster
Which packages *did* you install? Mine on etch does have pg_config,
and it has the headers, too. That said, there's a PHP postgres
package available as well.
Code:

apt-cache search php | grep -i postgr
php4-pgsql - PostgreSQL module for php4
php5-pgsql - PostgreSQL module for php5
phppgadmin - Set of PHP scripts to administrate PostgreSQL over the WWW



Cheers,
Tink

Interesting, I guess I will never know why I was missing that file. I just went with Ubuntu 6.06 Server, and used apt-get to install everything =D.

Tinkster 03-14-2007 08:02 PM

So all has fallen into place, then? :)


Cheers,
Tink


All times are GMT -5. The time now is 11:36 PM.