pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Httpd2.0 / PHP / PostgreSQL
4+ messages / 3 participants
[nested] [flat]

* Httpd2.0 / PHP / PostgreSQL
@ 2002-12-10 05:18  sharmad@softhome.net
  0 siblings, 1 reply; 4+ messages in thread

From: sharmad@softhome.net @ 2002-12-10 05:18 UTC (permalink / raw)
  To: pgsql-php

Hi all,
     I have installed redhat8.0 on my system. When i made phpinfo.php file 
containing <? phpinfo(); ?> and ran the script it just doen't connect to the 
pgsql database although all servers are started (httpd and postgresql) and 
the php-pgsql rpm too is there.
     I can query the database at the command prompt but not from the brower. 
Can anyone tell me whats wrong
     This problem doesn't exist in redhat 7.1 or so 

Regards and thx
Sharmad



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Httpd2.0 / PHP / PostgreSQL
@ 2002-12-10 06:43  Frank Bax <fbax@sympatico.ca>
  parent: sharmad@softhome.net
  0 siblings, 0 replies; 4+ messages in thread

From: Frank Bax @ 2002-12-10 06:43 UTC (permalink / raw)
  To: sharmad@softhome.net; pgsql-php

At 12:18 AM 12/10/02, sharmad@softhome.net wrote:
>Hi all,
>     I have installed redhat8.0 on my system. When i made phpinfo.php file 
> containing <? phpinfo(); ?> and ran the script it just doen't connect to 
> the pgsql database although all servers are started (httpd and 
> postgresql) and the php-pgsql rpm too is there.
>     I can query the database at the command prompt but not from the 
> brower. Can anyone tell me whats wrong
>     This problem doesn't exist in redhat 7.1 or so


Have a closer look at your phpinfo output ... One of the first items 
displayed is "Configure Command"  - it contains a bunch of things like 
--with-xx and/or --without-xxx
Does it say --with-pgsql or --without-pgsql - if "without", then php was 
not compiled with support for postgresql.




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Httpd2.0 / PHP / PostgreSQL
@ 2002-12-10 07:27  sharmad@softhome.net
  0 siblings, 0 replies; 4+ messages in thread

From: sharmad@softhome.net @ 2002-12-10 07:27 UTC (permalink / raw)
  To: pgsql-php

Hi ,
Thanks firstly for all the replies i got for the mail : 

I have changed the pg_hba.conf file in the following manner :
 ------------------------------------------------------------ 

local   all     ident   sameuser
host    all     127.0.0.1       255.255.255.255 trust
host    lms     192.168.100.0   255.255.255.0   trust 

 ------------------------------------------------------------
where lms is the database
and also changed tcpip_socket to true 

the phpinfo() also shows me support for PostgreSQL as :
 --with-pgsql=shared
I have touched and edited/made user for apache in postgres as stated in 
httpd/conf.d/auth_pgsql.conf file
I still get the following error
 ------------------------------------------------------------
Warning: pg_pconnect() unable to connect to PostgreSQL server: FATAL 1: 
IDENT authentication failed for user "dbname=lms" in 
/home/pro/public_html/common.php on line 9 

Warning: pg_exec(): supplied argument is not a valid PostgreSQL link 
resource in /home/pro/public_html/common.php on line 11 

Warning: pg_errormessage(): supplied argument is not a valid PostgreSQL link 
resource in /home/pro/public_html/common.php on line 32
NO CONNECTION -
 ------------------------------------------------------------ 

Thanks and Rgrds
Sharmad Naik 

Kelvin Varst writes: 

> 
> Hi, 
> 
> Have you changed the pg_hba file? The only connection allowed by default is
> from 127.0.0.1. You should also change tcpip_socket to TRUE in the
> postgresql.conf, otherwise the database do not accept connections from the
> network. 
> 
> Kelvin :-) 
> 
> -----Oprindelig meddelelse-----
> Fra: pgsql-php-owner@postgresql.org
> [mailto:pgsql-php-owner@postgresql.org]På vegne af sharmad@softhome.net
> Sendt: 10. december 2002 06:19
> Til: pgsql-php@postgresql.org
> Emne: [PHP] Httpd2.0 / PHP / PostgreSQL 
> 
>  
> 
> Hi all,
>      I have installed redhat8.0 on my system. When i made phpinfo.php file
> containing <? phpinfo(); ?> and ran the script it just doen't connect to the
> pgsql database although all servers are started (httpd and postgresql) and
> the php-pgsql rpm too is there.
>      I can query the database at the command prompt but not from the brower.
> Can anyone tell me whats wrong
>      This problem doesn't exist in redhat 7.1 or so 
> 
> Regards and thx
> Sharmad 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ? 
> 
> http://www.postgresql.org/users-lounge/docs/faq.html 
> 
> 
 


Feel free to contact me (flames about my english and the useless of this 
driver will be redirected to /dev/null, oh no, it's full...).   (Michael 
Beck, describing the PC-speaker sound device) 




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Httpd2.0 / PHP / PostgreSQL
@ 2002-12-10 07:45  Kelvin Varst <kelvin@varst.dk>
  0 siblings, 0 replies; 4+ messages in thread

From: Kelvin Varst @ 2002-12-10 07:45 UTC (permalink / raw)
  To: sharmad@softhome.net; pgsql-php


Hi,

I don't know how you connect, but if you write something like:

$db_conn = pg_connect("host=your_servername dbname=lms user=someone
password=whatever")
	or die("Something is wrong!");

and in the pg_hba.conf:
host    lms     192.168.100.0   255.255.255.0   trust sameuser

then it should work, if someone is allowed to use the database lms.
Offcourse you should restart PostgreSQL when you change these files.

I also have:

host    all     0.0.0.0   0.0.0.0   md5

in my pg_hba.conf. Then all users can use the database, if they supply a
valid password.

Kelvin :-)


-----Oprindelig meddelelse-----
Fra: pgsql-php-owner@postgresql.org
[mailto:pgsql-php-owner@postgresql.org]På vegne af sharmad@softhome.net
Sendt: 10. december 2002 08:27
Til: pgsql-php@postgresql.org
Emne: Re: [PHP] Httpd2.0 / PHP / PostgreSQL



Hi ,
Thanks firstly for all the replies i got for the mail :

I have changed the pg_hba.conf file in the following manner :
 ------------------------------------------------------------

local   all     ident   sameuser
host    all     127.0.0.1       255.255.255.255 trust
host    lms     192.168.100.0   255.255.255.0   trust

 ------------------------------------------------------------
where lms is the database
and also changed tcpip_socket to true

the phpinfo() also shows me support for PostgreSQL as :
 --with-pgsql=shared
I have touched and edited/made user for apache in postgres as stated in
httpd/conf.d/auth_pgsql.conf file
I still get the following error
 ------------------------------------------------------------
Warning: pg_pconnect() unable to connect to PostgreSQL server: FATAL 1:
IDENT authentication failed for user "dbname=lms" in
/home/pro/public_html/common.php on line 9

Warning: pg_exec(): supplied argument is not a valid PostgreSQL link
resource in /home/pro/public_html/common.php on line 11

Warning: pg_errormessage(): supplied argument is not a valid PostgreSQL link
resource in /home/pro/public_html/common.php on line 32
NO CONNECTION -
 ------------------------------------------------------------

Thanks and Rgrds
Sharmad Naik

Kelvin Varst writes:

>
> Hi,
>
> Have you changed the pg_hba file? The only connection allowed by default
is
> from 127.0.0.1. You should also change tcpip_socket to TRUE in the
> postgresql.conf, otherwise the database do not accept connections from the
> network.
>
> Kelvin :-)
>
> -----Oprindelig meddelelse-----
> Fra: pgsql-php-owner@postgresql.org
> [mailto:pgsql-php-owner@postgresql.org]På vegne af sharmad@softhome.net
> Sendt: 10. december 2002 06:19
> Til: pgsql-php@postgresql.org
> Emne: [PHP] Httpd2.0 / PHP / PostgreSQL
>
>
>
> Hi all,
>      I have installed redhat8.0 on my system. When i made phpinfo.php file
> containing <? phpinfo(); ?> and ran the script it just doen't connect to
the
> pgsql database although all servers are started (httpd and postgresql) and
> the php-pgsql rpm too is there.
>      I can query the database at the command prompt but not from the
brower.
> Can anyone tell me whats wrong
>      This problem doesn't exist in redhat 7.1 or so
>
> Regards and thx
> Sharmad
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
>



Feel free to contact me (flames about my english and the useless of this
driver will be redirected to /dev/null, oh no, it's full...).   (Michael
Beck, describing the PC-speaker sound device)


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2002-12-10 07:45 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-12-10 05:18 Httpd2.0 / PHP / PostgreSQL sharmad@softhome.net
2002-12-10 06:43 ` Frank Bax <fbax@sympatico.ca>
2002-12-10 07:27 Re: Httpd2.0 / PHP / PostgreSQL sharmad@softhome.net
2002-12-10 07:45 Re: Httpd2.0 / PHP / PostgreSQL Kelvin Varst <kelvin@varst.dk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox