Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-08-2003, 02:54 AM   #1
Sridhar Guntur
LQ Newbie
Registered: Oct 2002
Location: 808 Ridge Drive apt #110 Dekalb IL-60115
Distribution: RedHat 7.2
Posts: 11

Rep: Reputation: 0
how to link apache+php+postgresql

My system features are:

redhat linux ------- 7.3
apache ------- 1.3.23
php ------- 4.1.2
postgresql ------- 7.2.1.

Could someone please guide me to a how-to (or give me a step by step procedure) to link apache,php,postgresql. Google search and forum search did not help.
Thank you.
Old 01-08-2003, 02:56 AM   #2
Registered: Feb 2002
Location: India
Distribution: Slacky 12.1, XP
Posts: 992

Rep: Reputation: 30
what do you mean 'to link'
Old 01-08-2003, 10:18 PM   #3
Sridhar Guntur
LQ Newbie
Registered: Oct 2002
Location: 808 Ridge Drive apt #110 Dekalb IL-60115
Distribution: RedHat 7.2
Posts: 11

Original Poster
Rep: Reputation: 0

By linking I meant, i want to do these 2 things,
1.configure PHP to include PostgreSQL support
2.and then install PHP as an Apache module

command , httpd -l, gave me the following output,
Compiled in modules:

so i dont have mod_php compiled for httpd.

I have php,postgresql,apache as they were given in redhat 7.3.
what steps do i need to take to do the 2 things i mentioned before?

i have the following lines un-commented in my httpd .conf file
<IfDefine HAVE_PHP>
LoadModule php_module modules/
<IfDefine HAVE_PHP3>
LoadModule php3_module modules/
<IfDefine HAVE_PHP4>
LoadModule php4_module modules/

<IfDefine HAVE_PHP>
AddModule mod_php.c
<IfDefine HAVE_PHP3>
AddModule mod_php3.c
<IfDefine HAVE_PHP4>
AddModule mod_php4.c

<IfModule mod_php4.c>
AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
<IfModule mod_php3.c>
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
<IfModule mod_php.c>
AddType application/x-httpd-php .phtml
Thank you
Old 01-09-2003, 02:22 AM   #4
Senior Member
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
You need to recompile php and apache from scratch if you want php as a module. You should upgrade to at least 1.3.26 anyway, because of security concerns (see Then, and this is from

1.  gunzip apache_1.3.x.tar.gz
2.  tar xvf apache_1.3.x.tar
3.  gunzip php-x.x.x.tar.gz
4.  tar xvf php-x.x.x.tar
5.  cd apache_1.3.x
6.  ./configure --prefix=/www
7.  cd ../php-x.x.x
8.  ./configure --with-pgsql --with-apache=../apache_1.3.x --enable-track-vars
9.  make
10. make install
11. cd ../apache_1.3.x
12. ./configure --activate-module=src/modules/php4/libphp4.a
13. make
14. make install
15. cd ../php-x.x.x
16. cp php.ini-dist /usr/local/lib/php.ini
17. Edit your httpd.conf or srm.conf file and add: 
      AddType application/x-httpd-php .php

18. Use your normal procedure for restarting the Apache server. (You must
    stop and restart the server, not just cause the server to reload by
    use a HUP or USR1 signal.)

Last edited by bulliver; 01-09-2003 at 02:25 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux + Apache + PHP + ??MySQL/PostgreSQL?? Thakowbbery Linux - Enterprise 4 10-28-2005 04:18 PM
Apache,PHP and PostgreSQL in a package Boby Linux - Software 1 03-29-2005 07:21 PM
Apache+Postgresql+PHP. reconfigure? vickr1z Linux - Newbie 2 08-23-2004 03:58 AM
Apache-php-postgresql-phppgadmin koswo Linux - Software 0 02-05-2004 07:05 AM
PHP + PostgreSQL + Apache - What slows down my browser? J_Szucs Programming 4 09-08-2003 06:33 PM > Forums > Linux Forums > Linux - General

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration