Click to See Complete Forum and Search --> : how to link apache + php + postgresql
Sridhar Guntur
01-08-2003, 03:41 AM
Hello,
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.
Hi
Mundu PHP manual chadavandi. Andulo anta vistaaram ga raasi vundi. Chadivina taruvatha kuda emanna doubts vunte, ikkadiki randi.
Regards
theN
ps: :) could't resist that...his surname is the place where I was born.
Sridhar Guntur
01-08-2003, 11:22 PM
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:
http_core.c
mod_so.c
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/mod_php.so
</IfDefine>
<IfDefine HAVE_PHP3>
LoadModule php3_module modules/libphp3.so
</IfDefine>
<IfDefine HAVE_PHP4>
LoadModule php4_module modules/libphp4.so
</IfDefine>
<IfDefine HAVE_PHP>
AddModule mod_php.c
</IfDefine>
<IfDefine HAVE_PHP3>
AddModule mod_php3.c
</IfDefine>
<IfDefine HAVE_PHP4>
AddModule mod_php4.c
</IfDefine>
<IfModule mod_php4.c>
AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>
<IfModule mod_php3.c>
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
</IfModule>
<IfModule mod_php.c>
AddType application/x-httpd-php .phtml
</IfModule>
-------------------------------------------------------------------------------------------
Thank you
By the way theN, i am happy to hear telugu(naa maatrubhasha and nityam matlade bhasha) in this forum.
Originally posted by Sridhar Guntur
By linking I meant, i want to do these 2 things...Got it the first time.
And I suggested you read the PHP Manual first. Did you? coz you would've saved yourself the time of posting here. It took me less than 5minutes to find out what you needed...
Look at the following links -
* PHP.net - Servers-Apache1.3.xx (http://www.php.net/manual/en/install.apache.php)
lines 9...12 are what you need, with line 10 modified to
./configure --with-pgsql[=/path/to/pgsql_dir] --with-apache[=/path/to/apache_dir]After you finish configuration, restart Apache if its already running.
* Read the PHP.net - Complete list of configure options (http://www.php.net/manual/en/install.configure.php) first.
Why statically compile PHP into Apache? are you running a production server?
Regards
theN
Sridhar Guntur
01-09-2003, 04:01 PM
Thanks for your suggestion, but i still need some information,
___________________________________
./configure --with-pgsql[=/path/to/pgsql_dir] --with-apache[=/path/to/apache_dir]
_____________________________________
Iam sorry, iam being very stupid. I suppose "configure" is a script and i think it might be in the php source directory. But i dont know where this php source directory exists in Redhat 7.3.(or are you suggesting me to download php source and then configure?). and what would be path to pgsql_dir and path to apache_dir mean?
There are php,apache,pgsql directories in /usr/lib. and there are some (.so) files in /usr/lib/apache directory and one plpgsql.so file in /usr/lib/pgsql directory and in /usr/lib/php directory there is another directory called "build". and i tried to execute ./configure in /usr/lib/php directory but i got an error "no such file or directory" . I think i am not executing configure in the correct directory.
(I could get correct results by typing
php test.php in the terminal but not in browser)
Iam sorry iam a student and still a newbie.
Thanks again,
Sridhar Guntur
I could get correct results by typing php test.php in the terminal but not in browser
Seems all the software you need is already installed and PHP is a DSO. Maybe its only a matter of configuring them.
To make PHP work with Apache, try adding the following lines to Apache httpd.conf, under the appropriate sections -
AddType application/x-httpd-php .php and
LoadModule php4_module path_to/libphp4.so
To make Postgre work with PHP, you need to make changes in the php.ini file. Never seen Postgre, so can't help you with that.
Regards
theN
Sridhar Guntur
01-10-2003, 08:08 AM
Thank You,
Yes, Your suggestion worked.Actually i had those lines in my httpd.conf file but they were enclosed in ifdefine ..../ifdefine condition.once i commented those ifdefine and /ifdefine lines, apache could work with php scripts.
Thankyou theN, Dhanyavaadalu.
Sridhar Guntur.
Hi
Glad to know you got it working. Have fun :)
Regards
theN