From sorturmuralidhar@rediffmail.com Mon Apr 3 17:13:41 2006 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E798C11F6B66 for ; Mon, 3 Apr 2006 14:13:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 33623-06 for ; Mon, 3 Apr 2006 14:13:39 -0300 (ADT) X-Greylist: delayed 00:06:37.50491 by SQLgrey- Received: from rediffmail.com (unknown [203.199.83.33]) by postgresql.org (Postfix) with SMTP id 340A911F6B78 for ; Mon, 3 Apr 2006 14:13:36 -0300 (ADT) Received: (qmail 19618 invoked by uid 510); 3 Apr 2006 17:06:11 -0000 Date: 3 Apr 2006 17:06:11 -0000 Message-ID: <20060403170611.19617.qmail@webmail47.rediffmail.com> Received: from unknown (203.200.43.195) by rediffmail.com via HTTP; 03 apr 2006 17:06:11 -0000 MIME-Version: 1.0 From: "muralidhar sortur" Reply-To: "muralidhar sortur" To: pgsql-php@postgresql.org Subject: Unable to connect to PostgreSQL Server: Permission denied Content-type: multipart/alternative; boundary="Next_1144083971---0-203.199.83.33-19612" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=3.264 required=5 tests=[DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_WHOIS=0.879, HTML_MESSAGE=0.001, MSGID_FROM_MTA_HEADER=0, RCVD_IN_NJABL_SPAM=1.905] X-Spam-Score: 3.264 X-Spam-Level: *** X-Archive-Number: 200604/1 X-Sequence-Number: 3471 This is a multipart mime message --Next_1144083971---0-203.199.83.33-19612 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =0AHi ,=0AHere is the complete description of the problem ...=0A=0AI have= newly installed fedora core 4 with option as everyting.=0A=0Ait comes with= apache webserver, postgresql , php-postgresql, php-gd etc,=0A=0Ait creates= a default user postgres with home =3D /var/lib/psql=0A=0A1. i loged in as = postgres=0A=0A2. called initdb=0A created database under directory ~/data= =0A=0A3. changed postgresql.conf to include=0A listen_addresses =3D '*= '=0A port =3D 5432=0A=0A4. changed pg_hba.conf=0A local all all= trust=0A host all all 127.0.0.1/32 = trust=0A host all all 192.168.1.18/24 trust=0A host = all all ::1/128 trust=0A=0A5. postmaster -i -D ~/data &=0A= =0A6. createdb AddressBook=0A=0A7. psql AddressBook=0A=0A8. create table ad= dresses( Name text, Phone text, Email text);=0A=0A9. create user www NOCREA= TEDB NOCREATEUSER;=0A=0A10. grant all on addresses to www;=0A=0A11. from ot= her terminal i loged in as root=0A=0A12. changed /etc/httpd/conf/httpd.conf= =0A=0A User www=0A Group postgres=0A=0A13. copied add.html and add-en= try.php into directory /var/www/html=0A=0Aadd.html=0A----------------------= --------------------------------=0A=0A=0A=0A
=0A=0A=0A =0A =0A =0A =0A <= /TR>=0A =0A =0A =0A =0A =0A =0A = =0A =0A = =0A =0A =0A
=0A <= TABLE BORDER=3D0 CELLPADDING=3D2 CELLSPACING=3D2>=0A
Name=
Phone
E-mail
=0A =0A
=0A =0A =0A=0A
=0A=0A=0A=0A--------------------------= ------------------------=0Aadd-entry.php=0A--------------------------------= ------------------=0A=0A=0A=0A";=0Ae= cho "Phone =3D $phoneResult
";=0Aecho "E-mail =3D $emailResult
";=0A= =0Apg_Close( $db );=0A?>=0A=0A

Add Okay!

=0A=0A=0A=0A-= ------------------------------------------------------------=0AError i get = is=0AMon Apr 03 18:39:53 2006] [notice] Apache/2.0.54 (Fedora) configured -= - resuming normal operations=0A[Mon Apr 03 18:42:17 2006] [error] [client 1= 27.0.0.1] File does not exist: /var/www/html/favicon.ico=0A[client 127.0.0.= 1] PHP Warning: pg_connect() [function.pg-= connect]: Unable to connect to PostgreSQL server: could not connect to = server: Permission denied\n\tIs the server running locally and accepting\n\= tconnections on Unix domain socket "/tmp/.s.PGSQL.5432"? in /var/= www/html/add-entry.php on line 5, referer: http://localhost/add.html=0A[Mon= Apr 03 18:42:22 2006] [error] [client 127.0.0.1] File does not exist: /var= /www/html/favicon.ico=0A=0A________________________________________________= _______=0A=0Afrom the command line it works fine=0Ai.e php add-entry.php wo= rks fine ( ofcourse adds an empty row into the data base)=0A=0A------------= --------------------------------------=0A=0Ai did telnet=0A=0A[root@localho= st html]# telnet localhost 5432=0ATrying 127.0.0.1...=0AConnected to localh= ost.localdomain (127.0.0.1).=0AEscape character is '^]'.=0A=0A=0AConnection= closed by foreign host.=0A=0Adata/pg_log/postgresql-Mon.log contains=0A=0A= LOG: invalid length of startup packet=0A=0A=0A=0A-------------------------= ------=0A=0A=0AI am not getting any clue as to how to solve this problem ..= .let me know if you have any idea in solving this porblem.=0A=0Aregards=0AM= uralidhar=0A=0A=0A --Next_1144083971---0-203.199.83.33-19612 Content-type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline

=0A 
=0AHi ,
=0AHere is the complete description of the prob= lem ...
=0A
=0AI have newly installed fedora core 4 with option as ev= eryting.
=0A
=0Ait comes with apache webserver, postgresql , php-post= gresql, php-gd etc,
=0A
=0Ait creates a default user postgres with ho= me =3D /var/lib/psql
=0A
=0A1. i loged in as postgres
=0A
=0A2.= called initdb
=0A  created database under directory ~/data
=0A<= BR>=0A3. changed postgresql.conf to include
=0A      list= en_addresses =3D '*'
=0A      port =3D 5432
=0A
=0A= 4. changed pg_hba.conf
=0A      local  all  all=                      = ;   trust
=0A      host    all  all&n= bsp; 127.0.0.1/32        trust
=0A    &nbs= p; host    all  all  192.168.1.18/24     = ; trust
=0A      host    all  all  &n= bsp;     ::1/128        trust
=0A
=0A5.= postmaster -i -D ~/data &
=0A
=0A6. createdb AddressBook
=0A<= BR>=0A7. psql AddressBook
=0A
=0A8. create table addresses( Name text= , Phone text, Email text);
=0A
=0A9. create user www NOCREATEDB NOCRE= ATEUSER;
=0A
=0A10. grant all on addresses to www;
=0A
=0A11. f= rom other terminal i loged in as root
=0A
=0A12. changed /etc/httpd/c= onf/httpd.conf
=0A
=0A    User www
=0A    Grou= p postgres
=0A
=0A13. copied add.html and add-entry.php into director= y /var/www/html
=0A
=0Aadd.html
=0A-------------------------------= -----------------------
=0A<HTML>
=0A<BODY>
=0A
=0A= <FORM ACTION=3D"add-entry.php" METHOD=3D"GET">=0A
=0A<TABLE BORDER=3D1>
=0A  <TR>
=0A  &l= t;TD>
=0A  <TABLE BORDER=3D0 CELLPADDING=3D2 CELLSPACING=3D2&= gt;
=0A    <TR>
=0A    <TD>Name</T= D>
=0A    <TD><INPUT TYPE=3D"TEXT" NAME= =3D"Name" VALUE=3D""></TD>
=0A   = </TR>
=0A    <TR>
=0A    <TD>P= hone</TD>
=0A    <TD><INPUT TYPE=3D"TEXT&q= uot; NAME=3D"Phone" VALUE=3D""></TD>
=0A&nb= sp;   </TR>
=0A    <TR>
=0A    &= lt;TD>E-mail</TD>
=0A    <TD><INPUT TYPE=3D&= quot;TEXT" NAME=3D"Email" VALUE=3D""></TD>= ;
=0A    </TR>
=0A    <TR>
=0A&nbs= p;   <TD COLSPAN=3D2 ALIGN=3DCENTER>
=0A      = <INPUT TYPE=3D"SUBMIT" VALUE=3D"Add Entry">
= =0A    </TD>
=0A    </TR>
=0A  &= lt;/TABLE>
=0A  </TD>
=0A  </TR>
=0A</= TABLE>
=0A</FORM>
=0A
=0A</BODY>
=0A</HTML>= ;
=0A--------------------------------------------------
=0Aadd-entry.= php
=0A--------------------------------------------------
=0A
=0A&= lt;HTML>
=0A<BODY>
=0A<?PHP
=0A$db =3D pg_Connect( &qu= ot;dbname=3DAddressBook user=3Dwww");
=0Aif( !$db )
=0A{
=0A&= nbsp; echo "Could not connect!";
=0A  exit;
=0A}
= =0A
=0A$Name=3D$_GET['Name'];
=0A$Email=3D$_GET['Email'];
=0A$Phon= e=3D$_GET['Phone'];
=0A
=0A$query =3D "INSERT INTO Addresses VAL= UES( '$Name', '$Phone', '$Email' );";
=0A
=0A$result =3D pg_Exec= ( $db, $query );
=0A
=0Aif( !$result )
=0A{
=0A  echo &quo= t;No result set returned!";
=0A  exit;
=0A}
=0A
=0A$r= ows =3D pg_NumRows( $result );
=0A
=0Aif( $rows =3D 0 )
=0A{
= =0A  echo "Add Failed.";
=0A  exit;
=0A}
=0A=0A$query =3D "SELECT * FROM Addresses WHERE \"Name\" =3D = '$Name';";
=0A
=0A$query =3D "SELECT * FROM Addresses WHERE= \"Name\" =3D '$Name';";
=0A
=0A$result =3D pg_Exec( $= db, $query );
=0A$row =3D pg_Fetch_Row( $result, 0 );
=0A
=0A$name= Result =3D $row[0];
=0A$phoneResult =3D $row[1];
=0A$emailResult =3D = $row[2];
=0A
=0Aecho "Name =3D $nameResult<BR>";
= =0Aecho "Phone =3D $phoneResult<BR>";
=0Aecho "E-ma= il =3D $emailResult<BR>";
=0A
=0Apg_Close( $db );
=0A?&= gt;
=0A
=0A<H3>Add Okay!</H3>
=0A
=0A</BODY><= BR>=0A</HTML>
=0A-------------------------------------------------= ------------
=0AError i get is
=0AMon Apr 03 18:39:53 2006] [notice] = Apache/2.0.54 (Fedora) configured -- resuming normal operations
=0A[Mon = Apr 03 18:42:17 2006] [error] [client 127.0.0.1] File does not exist: /var/= www/html/favicon.ico
=0A[client 127.0.0.1] PHP Warning:  pg_connect= () [<a href=3D'function.pg-connect'>function.pg-connect</a>]: U= nable to connect to PostgreSQL server: could not connect to server: Permiss= ion denied\n\tIs the server running locally and accepting\n\tconnections on= Unix domain socket &quot;/tmp/.s.PGSQL.5432&quot;? in /var/www/htm= l/add-entry.php on line 5, referer: http://localhost/add.html
=0A[Mon Ap= r 03 18:42:22 2006] [error] [client 127.0.0.1] File does not exist: /var/ww= w/html/favicon.ico
=0A
=0A___________________________________________= ____________
=0A
=0Afrom the command line it works fine
=0Ai.e php= add-entry.php works fine ( ofcourse adds an empty row into the data base)<= BR>=0A
=0A--------------------------------------------------
=0A
= =0Ai did telnet
=0A
=0A[root@localhost html]# telnet localhost 5432=0ATrying 127.0.0.1...
=0AConnected to localhost.localdomain (127.0.0.= 1).
=0AEscape character is '^]'.
=0A
=0A
=0AConnection closed b= y foreign host.
=0A
=0Adata/pg_log/postgresql-Mon.log contains
=0A=
=0ALOG:  invalid length of startup packet
=0A
=0A
=0A
= =0A-------------------------------
=0A
=0A
=0AI am not getting any= clue as to how to solve this problem ...let me know if you have any idea i= n solving this porblem.
=0A
=0Aregards
=0AMuralidhar
=0A
=0A=
=0A=0A

=0A

=0A=0A --Next_1144083971---0-203.199.83.33-19612-- From skoot@qi.pl Mon Apr 3 20:03:36 2006 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id AA38E11F6106 for ; Mon, 3 Apr 2006 17:03:36 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 69785-06 for ; Mon, 3 Apr 2006 17:03:32 -0300 (ADT) X-Greylist: delayed 00:06:39.509786 by SQLgrey- Received: from pb78.olsztyn.sdi.tpnet.pl. (pb78.olsztyn.sdi.tpnet.pl [213.76.235.78]) by postgresql.org (Postfix) with ESMTP id B6BF611F660D for ; Mon, 3 Apr 2006 17:03:29 -0300 (ADT) Received: (qmail 9825 invoked by uid 1000); 3 Apr 2006 22:01:23 +0200 Date: Mon, 3 Apr 2006 22:01:23 +0200 From: Mariusz =?iso-8859-2?Q?P=EAkala?= To: pgsql-php@postgresql.org Subject: Re: Unable to connect to PostgreSQL Server: Permission denied Message-ID: <20060403200123.GB9357@cthulhu.sdi.tpnet.pl> Mail-Followup-To: pgsql-php@postgresql.org References: <20060403170611.19617.qmail@webmail47.rediffmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uQr8t48UFsdbeI+V" Content-Disposition: inline In-Reply-To: <20060403170611.19617.qmail@webmail47.rediffmail.com> User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200604/2 X-Sequence-Number: 3472 --uQr8t48UFsdbeI+V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2006-04-03 17:06:11 -0000 (Mon, Apr), muralidhar sortur wrote: > =20 > Hi , > Here is the complete description of the problem ... >=20 > I have newly installed fedora core 4 with option as everyting. [...] > ------------------------------------------------------------- > Error i get is > [client 127.0.0.1] PHP Warning: pg_connect(): Unable to connect to > PostgreSQL server: could not connect to server: Permission > denied\n\tIs the server running locally and accepting\n\tconnections > on Unix domain socket "/tmp/.s.PGSQL.5432"? in > /var/www/html/add-entry.php on line 5, referer: > http://localhost/add.html How does the file /tmp/.s.PGSQL.* look like? Does 'www' user have access to it? ls -l /tmp/.s.PGSQL.* As you enabled network interface in postgresql, you may try to add 'host=3D127.0.0.1' to your pg_connect function. This should let 'www' user to connect. > [root@localhost html]# telnet localhost 5432 > Trying 127.0.0.1... > Connected to localhost.localdomain (127.0.0.1). > Escape character is '^]'. >=20 >=20 > Connection closed by foreign host. >=20 > data/pg_log/postgresql-Mon.log contains >=20 > LOG: invalid length of startup packet Telnet is not the best tool for binary protocols. You may try netcat (nc), but anyway - this test is not significant here. By the way, you used this construction: > $Name=3D$_GET['Name']; > $Email=3D$_GET['Email']; > $Phone=3D$_GET['Phone']; >=20 > $query =3D "INSERT INTO Addresses VALUES( '$Name', '$Phone', '$Email' );"; Forgive me if that is only because this is test, and you know that, but I just HAVE to say: Don't let the untrusted parameters to go into query. Someone may call your page like this: http://example.com/add-entry.php?Email=3Da'); delete from Addresses; -- As *MINIMAL* precaution use: $Name =3D pg_escape_string( $_GET['Name'); --=20 No virus found in this outgoing message. Checked by "grep -i virus $MESSAGE" Trust me. --uQr8t48UFsdbeI+V Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFEMX8TIzblgXdKMIURAvB8AKCVmy45QPOfaGD5HHDg6f6BVJlaNACgu7Cc yvIgquNLb3eNvwVa2AK2rfM= =r9kI -----END PGP SIGNATURE----- --uQr8t48UFsdbeI+V-- From nediam@nediam.com.mx Tue Apr 4 05:13:11 2006 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 2623011F6315 for ; Tue, 4 Apr 2006 02:13:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 89906-07 for ; Tue, 4 Apr 2006 02:13:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from nediam.com.mx (unknown [69.93.89.140]) by postgresql.org (Postfix) with SMTP id 7352311F6272 for ; Tue, 4 Apr 2006 02:13:08 -0300 (ADT) Received: (qmail 11287 invoked from network); 4 Apr 2006 05:13:07 -0000 Received: from unknown (HELO mail.nediam.com.mx) (127.0.89.140) by nediam.com.mx with SMTP; 4 Apr 2006 05:13:07 -0000 Received: from 201.139.153.195 (SquirrelMail authenticated user nediam) by mail.nediam.com.mx with HTTP; Tue, 4 Apr 2006 00:13:07 -0500 (CDT) Message-ID: <65133.201.139.153.195.1144127587.squirrel@mail.nediam.com.mx> In-Reply-To: <20060403170611.19617.qmail@webmail47.rediffmail.com> References: <20060403170611.19617.qmail@webmail47.rediffmail.com> Date: Tue, 4 Apr 2006 00:13:07 -0500 (CDT) Subject: Re: Unable to connect to PostgreSQL Server: Permission denied From: "Javier Carlos" To: "muralidhar sortur" Cc: pgsql-php@postgresql.org User-Agent: SquirrelMail/1.4.6 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200604/3 X-Sequence-Number: 3473 Did you try to restart the PosgreSQL server using pg_ctl ? $ pg_ctl restart Are you able to connect as user from the command line? $ psql AddressBook www Regards, Javier > > Hi , > Here is the complete description of the problem ... > > I have newly installed fedora core 4 with option as everyting. > > it comes with apache webserver, postgresql , php-postgresql, php-gd etc, > > it creates a default user postgres with home = /var/lib/psql > > 1. i loged in as postgres > > 2. called initdb > created database under directory ~/data > > 3. changed postgresql.conf to include > listen_addresses = '*' > port = 5432 > > 4. changed pg_hba.conf > local all all trust > host all all 127.0.0.1/32 trust > host all all 192.168.1.18/24 trust > host all all ::1/128 trust > > 5. postmaster -i -D ~/data & > > 6. createdb AddressBook > > 7. psql AddressBook > > 8. create table addresses( Name text, Phone text, Email text); > > 9. create user www NOCREATEDB NOCREATEUSER; > > 10. grant all on addresses to www; > > 11. from other terminal i loged in as root > > 12. changed /etc/httpd/conf/httpd.conf > > User www > Group postgres > > 13. copied add.html and add-entry.php into directory /var/www/html > > add.html > ------------------------------------------------------ > > > >
> > > > > >
> > > > > > > > > > > > > > > > >
Name
Phone
E-mail
> >
>
>
> > > > -------------------------------------------------- > add-entry.php > -------------------------------------------------- > > > > $db = pg_Connect( "dbname=AddressBook user=www"); > if( !$db ) > { > echo "Could not connect!"; > exit; > } > > $Name=$_GET['Name']; > $Email=$_GET['Email']; > $Phone=$_GET['Phone']; > > $query = "INSERT INTO Addresses VALUES( '$Name', '$Phone', '$Email' );"; > > $result = pg_Exec( $db, $query ); > > if( !$result ) > { > echo "No result set returned!"; > exit; > } > > $rows = pg_NumRows( $result ); > > if( $rows = 0 ) > { > echo "Add Failed."; > exit; > } > > $query = "SELECT * FROM Addresses WHERE \"Name\" = '$Name';"; > > $query = "SELECT * FROM Addresses WHERE \"Name\" = '$Name';"; > > $result = pg_Exec( $db, $query ); > $row = pg_Fetch_Row( $result, 0 ); > > $nameResult = $row[0]; > $phoneResult = $row[1]; > $emailResult = $row[2]; > > echo "Name = $nameResult
"; > echo "Phone = $phoneResult
"; > echo "E-mail = $emailResult
"; > > pg_Close( $db ); > ?> > >

Add Okay!

> > > > ------------------------------------------------------------- > Error i get is > Mon Apr 03 18:39:53 2006] [notice] Apache/2.0.54 (Fedora) configured -- > resuming normal operations > [Mon Apr 03 18:42:17 2006] [error] [client 127.0.0.1] File does not exist: > /var/www/html/favicon.ico > [client 127.0.0.1] PHP Warning: pg_connect() [ href='function.pg-connect'>function.pg-connect]: Unable to connect to > PostgreSQL server: could not connect to server: Permission denied\n\tIs > the server running locally and accepting\n\tconnections on Unix domain > socket "/tmp/.s.PGSQL.5432"? in /var/www/html/add-entry.php on > line 5, referer: http://localhost/add.html > [Mon Apr 03 18:42:22 2006] [error] [client 127.0.0.1] File does not exist: > /var/www/html/favicon.ico > > _______________________________________________________ > > from the command line it works fine > i.e php add-entry.php works fine ( ofcourse adds an empty row into the > data base) > > -------------------------------------------------- > > i did telnet > > [root@localhost html]# telnet localhost 5432 > Trying 127.0.0.1... > Connected to localhost.localdomain (127.0.0.1). > Escape character is '^]'. > > > Connection closed by foreign host. > > data/pg_log/postgresql-Mon.log contains > > LOG: invalid length of startup packet > > > > ------------------------------- > > > I am not getting any clue as to how to solve this problem ...let me know > if you have any idea in solving this porblem. > > regards > Muralidhar > > > ------------- nediam.com.mx From sorturmuralidhar@rediffmail.com Tue Apr 4 13:54:07 2006 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id D7B6F11F6D42 for ; Tue, 4 Apr 2006 10:54:07 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 40276-06 for ; Tue, 4 Apr 2006 10:54:01 -0300 (ADT) X-Greylist: delayed 00:06:38.6847 by SQLgrey- Received: from rediffmail.com (unknown [203.199.83.42]) by postgresql.org (Postfix) with SMTP id 740BA11F662B for ; Tue, 4 Apr 2006 10:53:56 -0300 (ADT) Received: (qmail 22094 invoked by uid 510); 4 Apr 2006 13:46:32 -0000 Date: 4 Apr 2006 13:46:32 -0000 Message-ID: <20060404134632.22093.qmail@webmail55.rediffmail.com> Received: from unknown (203.200.43.195) by rediffmail.com via HTTP; 04 apr 2006 13:46:32 -0000 MIME-Version: 1.0 From: "muralidhar sortur" Reply-To: "muralidhar sortur" To: "Javier Carlos" , "Gnanavel S" , "pgsql_php" Subject: Re: Unable to connect to PostgreSQL Server: Permission denied Content-type: multipart/alternative; boundary="Next_1144158392---0-203.199.83.42-22090" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=2.365 required=5 tests=[AWL=0.459, HTML_MESSAGE=0.001, MSGID_FROM_MTA_HEADER=0, RCVD_IN_NJABL_SPAM=1.905] X-Spam-Score: 2.365 X-Spam-Level: ** X-Archive-Number: 200604/4 X-Sequence-Number: 3474 This is a multipart mime message --Next_1144158392---0-203.199.83.42-22090 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =0AHi ,=0Ain my last mail i forgot to mention that i have restarted apach= e server after making changes to the httpd.conf.=0A=0AToday i made one more= experiment ...=0A=0A1. changed httpd.conf =0A=0A user apache=0A Grou= p apache=0A=0A DocumentRoot=3D"/home/murali/html"=0A=0A =0A ......(as it is)....=0A =0A=0A= 2. copied the files add.html and add-entry.html to directory html under my = home directory i.e =0A=0A/home/murali/html=0A=0A3. restarted apache=0A/usr/= sbin/apachectl start ( from root)=0A=0A4. from postgres login started postm= aster.=0A=0Apostmaster -i -D data&=0A=0A5. http://localhost/add.html ( ente= red Name , Phone , Email)=0A =0AEVERY THING WORKED !!!!!=0A=0ABUT CAN ANY= ONE TELL ME, WHAT WAS THE PROBLEM WITH EARLIER SETTING AND WHAT MADE IT TO= WORK PROPERLY NOW !!! I NEED TO ANSWER THESE QUESTIONS=0A=0A=0AThanks for = all of your help =0Aregards=0AMuralidhar=0A=0AOn Tue, 04 Apr 2006 Javier Ca= rlos wrote :=0A> Did you try to restart the PosgreSQL server using pg_ctl= ?=0A>=0A>$ pg_ctl restart=0A>=0A>=0A> Are you able to connect as user f= rom the command line?=0A>=0A>$ psql AddressBook www=0A>=0A> Regards,=0A>= =0A> Javier=0A>=0A>=0A> >=0A> > Hi ,=0A> > Here is the complete descripti= on of the problem ...=0A> >=0A> > I have newly installed fedora core 4 with= option as everyting.=0A> >=0A> > it comes with apache webserver, postgresq= l , php-postgresql, php-gd etc,=0A> >=0A> > it creates a default user postg= res with home =3D /var/lib/psql=0A> >=0A> > 1. i loged in as postgres=0A> >= =0A> > 2. called initdb=0A> > created database under directory ~/data=0A>= >=0A> > 3. changed postgresql.conf to include=0A> > listen_addresses= =3D '*'=0A> > port =3D 5432=0A> >=0A> > 4. changed pg_hba.conf=0A> >= local all all trust=0A> > host all= all 127.0.0.1/32 trust=0A> > host all all 192.168.1.18= /24 trust=0A> > host all all ::1/128 trust=0A>= >=0A> > 5. postmaster -i -D ~/data &=0A> >=0A> > 6. createdb AddressBook= =0A> >=0A> > 7. psql AddressBook=0A> >=0A> > 8. create table addresses( Nam= e text, Phone text, Email text);=0A> >=0A> > 9. create user www NOCREATEDB = NOCREATEUSER;=0A> >=0A> > 10. grant all on addresses to www;=0A> >=0A> > 11= . from other terminal i loged in as root=0A> >=0A> > 12. changed /etc/httpd= /conf/httpd.conf=0A> >=0A> > User www=0A> > Group postgres=0A> >=0A= > > 13. copied add.html and add-entry.php into directory /var/www/html=0A> = >=0A> > add.html=0A> > ----------------------------------------------------= --=0A> > =0A> > =0A> >=0A> >
=0A> >=0A> > =0A> > =0A> > =0A= > > =0A> >
=0A> >= =0A> > =0A> > = =0A> > =0A> > =0A> > =0A> > =0A> > = =0A> > =0A= > > =0A> > =0A> > =0A> > =0A> > =0A> > =0A> > =0A> > =0A> > =0A> >
Name
Phone
E-mail
=0A> >
=0A> >
=0A> >=0A> > =0A> > = =0A> > --------------------------------------------------=0A> > add-entry.p= hp=0A> > --------------------------------------------------=0A> >=0A> > =0A> > =0A> > > $db =3D pg_Connect( "dbname=3DAddressBoo= k user=3Dwww");=0A> > if( !$db )=0A> > {=0A> > echo "Could not connect!";= =0A> > exit;=0A> > }=0A> >=0A> > $Name=3D$_GET['Name'];=0A> > $Email=3D$_= GET['Email'];=0A> > $Phone=3D$_GET['Phone'];=0A> >=0A> > $query =3D "INSERT= INTO Addresses VALUES( '$Name', '$Phone', '$Email' );";=0A> >=0A> > $resul= t =3D pg_Exec( $db, $query );=0A> >=0A> > if( !$result )=0A> > {=0A> > ec= ho "No result set returned!";=0A> > exit;=0A> > }=0A> >=0A> > $rows =3D p= g_NumRows( $result );=0A> >=0A> > if( $rows =3D 0 )=0A> > {=0A> > echo "A= dd Failed.";=0A> > exit;=0A> > }=0A> >=0A> > $query =3D "SELECT * FROM Ad= dresses WHERE \"Name\" =3D '$Name';";=0A> >=0A> > $query =3D "SELECT * FROM= Addresses WHERE \"Name\" =3D '$Name';";=0A> >=0A> > $result =3D pg_Exec( $= db, $query );=0A> > $row =3D pg_Fetch_Row( $result, 0 );=0A> >=0A> > $nameR= esult =3D $row[0];=0A> > $phoneResult =3D $row[1];=0A> > $emailResult =3D $= row[2];=0A> >=0A> > echo "Name =3D $nameResult
";=0A> > echo "Phone =3D = $phoneResult
";=0A> > echo "E-mail =3D $emailResult
";=0A> >=0A> > pg= _Close( $db );=0A> > ?>=0A> >=0A> >

Add Okay!

=0A> >=0A> > = =0A> > =0A> > ------------------------------------------------------= -------=0A> > Error i get is=0A> > Mon Apr 03 18:39:53 2006] [notice] Apach= e/2.0.54 (Fedora) configured --=0A> > resuming normal operations=0A> > [Mon= Apr 03 18:42:17 2006] [error] [client 127.0.0.1] File does not exist:=0A> = > /var/www/html/favicon.ico=0A> > [client 127.0.0.1] PHP Warning: pg_conne= ct() [ > href=3D'function.pg-connect'>function.pg-connect]: Unabl= e to connect to=0A> > PostgreSQL server: could not connect to server: Permi= ssion denied\n\tIs=0A> > the server running locally and accepting\n\tconnec= tions on Unix domain=0A> > socket "/tmp/.s.PGSQL.5432"? in /var/www/html/ad= d-entry.php on=0A> > line 5, referer: http://localhost/add.html=0A> > [Mon = Apr 03 18:42:22 2006] [error] [client 127.0.0.1] File does not exist:=0A> >= /var/www/html/favicon.ico=0A> >=0A> > ____________________________________= ___________________=0A> >=0A> > from the command line it works fine=0A> > i= .e php add-entry.php works fine ( ofcourse adds an empty row into the=0A> >= data base)=0A> >=0A> > --------------------------------------------------= =0A> >=0A> > i did telnet=0A> >=0A> > [root@localhost html]# telnet localho= st 5432=0A> > Trying 127.0.0.1...=0A> > Connected to localhost.localdomain = (127.0.0.1).=0A> > Escape character is '^]'.=0A> >=0A> >=0A> > Connection c= losed by foreign host.=0A> >=0A> > data/pg_log/postgresql-Mon.log contains= =0A> >=0A> > LOG: invalid length of startup packet=0A> >=0A> >=0A> >=0A> >= -------------------------------=0A> >=0A> >=0A> > I am not getting any clu= e as to how to solve this problem ...let me know=0A> > if you have any idea= in solving this porblem.=0A> >=0A> > regards=0A> > Muralidhar=0A> >=0A> >= =0A> >=0A>=0A>=0A>=0A>-------------=0A>nediam.com.mx=0A>=0A>=0A>-----------= ----------------(end of broadcast)---------------------------=0A>TIP 5: don= 't forget to increase your free space map settings=0A --Next_1144158392---0-203.199.83.42-22090 Content-type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline

=0A 
=0AHi ,
=0Ain my last mail i forgot to mention that i h= ave restarted apache server after making changes to the httpd.conf.
=0A<= BR>=0AToday i made one more experiment ...
=0A
=0A1. changed httpd.co= nf
=0A
=0A    user apache
=0A    Group apache=
=0A
=0A    DocumentRoot=3D"/home/murali/html"=0A
=0A    <DocumentRoot "/home/murali/html">=
=0A    ......(as it is)....
=0A    <DocumentR= oot>
=0A
=0A2. copied the files add.html and add-entry.html to dir= ectory html under my home directory i.e
=0A
=0A/home/murali/html
= =0A
=0A3. restarted apache
=0A/usr/sbin/apachectl start ( from root)<= BR>=0A
=0A4. from postgres login started postmaster.
=0A
=0Apostma= ster -i -D data&
=0A
=0A5. http://localhost/add.html ( entered Na= me , Phone , Email)
=0A 
=0AEVERY THING WORKED !!!!!
=0A=0ABUT CAN ANY ONE TELL ME, WHAT WAS THE PROBLEM WITH EARLIER SETTING AND = WHAT MADE IT TO WORK PROPERLY NOW !!! I NEED TO ANSWER THESE QUESTIONS
= =0A
=0A
=0AThanks for all of your help
=0Aregards
=0AMuralidha= r
=0A
=0AOn Tue, 04 Apr 2006 Javier Carlos wrote :
=0A>  = Did you try to restart the PosgreSQL server using pg_ctl ?
=0A>
= =0A>$ pg_ctl restart
=0A>
=0A>
=0A>    Are y= ou able to connect as user from the command line?
=0A>
=0A>$ ps= ql AddressBook www
=0A>
=0A>  Regards,
=0A>
=0A&= gt;  Javier
=0A>
=0A>
=0A> >
=0A> > Hi = ,
=0A> > Here is the complete description of the problem ...
= =0A> >
=0A> > I have newly installed fedora core 4 with opti= on as everyting.
=0A> >
=0A> > it comes with apache webse= rver, postgresql , php-postgresql, php-gd etc,
=0A> >
=0A> &= gt; it creates a default user postgres with home =3D /var/lib/psql
=0A&g= t; >
=0A> > 1. i loged in as postgres
=0A> >
=0A>= ; > 2. called initdb
=0A> >  created database under direc= tory ~/data
=0A> >
=0A> > 3. changed postgresql.conf to i= nclude
=0A> >      listen_addresses =3D '*'
=0A= > >      port =3D 5432
=0A> >
=0A> >= ; 4. changed pg_hba.conf
=0A> >      local  a= ll  all                  =       trust
=0A> >      host  =   all  all  127.0.0.1/32        trust=0A> >      host    all  all  19= 2.168.1.18/24      trust
=0A> >     = host    all  all        ::1/128  =       trust
=0A> >
=0A> > 5. postmaster -i= -D ~/data &
=0A> >
=0A> > 6. createdb AddressBook=0A> >
=0A> > 7. psql AddressBook
=0A> >
=0A>= ; > 8. create table addresses( Name text, Phone text, Email text);
= =0A> >
=0A> > 9. create user www NOCREATEDB NOCREATEUSER;=0A> >
=0A> > 10. grant all on addresses to www;
=0A>= >
=0A> > 11. from other terminal i loged in as root
=0A>= >
=0A> > 12. changed /etc/httpd/conf/httpd.conf
=0A> >= ;
=0A> >    User www
=0A> >    Grou= p postgres
=0A> >
=0A> > 13. copied add.html and add-entr= y.php into directory /var/www/html
=0A> >
=0A> > add.html=
=0A> > ------------------------------------------------------
= =0A> > <HTML>
=0A> > <BODY>
=0A> >
= =0A> > <FORM ACTION=3D"add-entry.php" METHOD=3D"GET= ">
=0A> >
=0A> > <TABLE BORDER=3D1>
=0A&= gt; >  <TR>
=0A> >  <TD>
=0A> >= ;  <TABLE BORDER=3D0 CELLPADDING=3D2 CELLSPACING=3D2>
=0A>= ; >    <TR>
=0A> >    <TD>Nam= e</TD>
=0A> >    <TD><INPUT TYPE=3D"= ;TEXT" NAME=3D"Name" VALUE=3D""></TD>
= =0A> >    </TR>
=0A> >    <TR= >
=0A> >    <TD>Phone</TD>
=0A> &g= t;    <TD><INPUT TYPE=3D"TEXT" NAME=3D"P= hone" VALUE=3D""></TD>
=0A> >   = </TR>
=0A> >    <TR>
=0A> > = ;   <TD>E-mail</TD>
=0A> >    <TD&= gt;<INPUT TYPE=3D"TEXT" NAME=3D"Email" VALUE=3D"= ;"></TD>
=0A> >    </TR>
=0A>= >    <TR>
=0A> >    <TD COLSPAN= =3D2 ALIGN=3DCENTER>
=0A> >      <INPUT TYPE= =3D"SUBMIT" VALUE=3D"Add Entry">
=0A> >&nbs= p;   </TD>
=0A> >    </TR>
=0A>= >  </TABLE>
=0A> >  </TD>
=0A> &= gt;  </TR>
=0A> > </TABLE>
=0A> > </= FORM>
=0A> >
=0A> > </BODY>
=0A> > <= /HTML>
=0A> > -------------------------------------------------= -
=0A> > add-entry.php
=0A> > ---------------------------= -----------------------
=0A> >
=0A> > <HTML>
=0A= > > <BODY>
=0A> > <?PHP
=0A> > $db =3D pg_= Connect( "dbname=3DAddressBook user=3Dwww");
=0A> > if( = !$db )
=0A> > {
=0A> >  echo "Could not connec= t!";
=0A> >  exit;
=0A> > }
=0A> >=0A> > $Name=3D$_GET['Name'];
=0A> > $Email=3D$_GET['Email'= ];
=0A> > $Phone=3D$_GET['Phone'];
=0A> >
=0A> >= $query =3D "INSERT INTO Addresses VALUES( '$Name', '$Phone', '$Email'= );";
=0A> >
=0A> > $result =3D pg_Exec( $db, $query= );
=0A> >
=0A> > if( !$result )
=0A> > {
=0A= > >  echo "No result set returned!";
=0A> >&= nbsp; exit;
=0A> > }
=0A> >
=0A> > $rows =3D pg= _NumRows( $result );
=0A> >
=0A> > if( $rows =3D 0 )
= =0A> > {
=0A> >  echo "Add Failed.";
=0A&= gt; >  exit;
=0A> > }
=0A> >
=0A> > $qu= ery =3D "SELECT * FROM Addresses WHERE \"Name\" =3D '$Name';= ";
=0A> >
=0A> > $query =3D "SELECT * FROM Addr= esses WHERE \"Name\" =3D '$Name';";
=0A> >
=0A&g= t; > $result =3D pg_Exec( $db, $query );
=0A> > $row =3D pg_Fet= ch_Row( $result, 0 );
=0A> >
=0A> > $nameResult =3D $row[= 0];
=0A> > $phoneResult =3D $row[1];
=0A> > $emailResult = =3D $row[2];
=0A> >
=0A> > echo "Name =3D $nameResul= t<BR>";
=0A> > echo "Phone =3D $phoneResult<BR&= gt;";
=0A> > echo "E-mail =3D $emailResult<BR>&quo= t;;
=0A> >
=0A> > pg_Close( $db );
=0A> > ?><= BR>=0A> >
=0A> > <H3>Add Okay!</H3>
=0A> &= gt;
=0A> > </BODY>
=0A> > </HTML>
=0A> = > -------------------------------------------------------------
=0A&g= t; > Error i get is
=0A> > Mon Apr 03 18:39:53 2006] [notice] A= pache/2.0.54 (Fedora) configured --
=0A> > resuming normal operati= ons
=0A> > [Mon Apr 03 18:42:17 2006] [error] [client 127.0.0.1] F= ile does not exist:
=0A> > /var/www/html/favicon.ico
=0A> &g= t; [client 127.0.0.1] PHP Warning:  pg_connect() [<a
=0A> >= ; href=3D'function.pg-connect'>function.pg-connect</a>]: Unable to= connect to
=0A> > PostgreSQL server: could not connect to server:= Permission denied\n\tIs
=0A> > the server running locally and acc= epting\n\tconnections on Unix domain
=0A> > socket "/tmp/.s.P= GSQL.5432"? in /var/www/html/add-entry.php on
=0A> > line 5, = referer: http://localhost/add.html
=0A> > [Mon Apr 03 18:42:22 200= 6] [error] [client 127.0.0.1] File does not exist:
=0A> > /var/www= /html/favicon.ico
=0A> >
=0A> > _________________________= ______________________________
=0A> >
=0A> > from the com= mand line it works fine
=0A> > i.e php add-entry.php works fine ( = ofcourse adds an empty row into the
=0A> > data base)
=0A> &= gt;
=0A> > --------------------------------------------------
= =0A> >
=0A> > i did telnet
=0A> >
=0A> > [= root@localhost html]# telnet localhost 5432
=0A> > Trying 127.0.0.= 1...
=0A> > Connected to localhost.localdomain (127.0.0.1).
=0A= > > Escape character is '^]'.
=0A> >
=0A> >
=0A&= gt; > Connection closed by foreign host.
=0A> >
=0A> >= data/pg_log/postgresql-Mon.log contains
=0A> >
=0A> > LO= G:  invalid length of startup packet
=0A> >
=0A> >=0A> >
=0A> > -------------------------------
=0A> &= gt;
=0A> >
=0A> > I am not getting any clue as to how to = solve this problem ...let me know
=0A> > if you have any idea in s= olving this porblem.
=0A> >
=0A> > regards
=0A> >= ; Muralidhar
=0A> >
=0A> >
=0A> >
=0A>
= =0A>
=0A>
=0A>-------------
=0A>nediam.com.mx
=0A&g= t;
=0A>
=0A>---------------------------(end of broadcast)------= ---------------------
=0A>TIP 5: don't forget to increase your free s= pace map settings
=0A=0A

=0A

=0A=0A --Next_1144158392---0-203.199.83.42-22090-- From CGMoller@StateStreet.com Tue Apr 4 14:01:06 2006 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id DF7DB11F6D4D for ; Tue, 4 Apr 2006 11:01:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 14935-02 for ; Tue, 4 Apr 2006 11:01:06 -0300 (ADT) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 3BD3E11F6AB1 for ; Tue, 4 Apr 2006 11:01:01 -0300 (ADT) Received: from svea0003.statestreet.com (svea0003.statestreet.com [192.250.112.146]) by svr4.postgresql.org (Postfix) with ESMTP id F02EF5AF905 for ; Tue, 4 Apr 2006 14:01:01 +0000 (GMT) Received: from svea0003.statestreet.com (localhost [127.0.0.1]) by svea0003.statestreet.com (Switch-3.1.8/Switch-3.1.7) with ESMTP id k34E0uY1026215; Tue, 4 Apr 2006 10:00:57 -0400 (EDT) Received: from smtp03w.statestr.com (inew2016.statestr.com [161.194.21.118]) by svea0003.statestreet.com (Switch-3.1.8/Switch-3.1.7) with ESMTP id k34E0u8Z026206; Tue, 4 Apr 2006 10:00:56 -0400 (EDT) Received: from mail37w.statestr.com ([161.194.69.147]) by smtp03w.statestr.com (Lotus Domino Release 6.0.3) with ESMTP id 2006040410005539-254893 ; Tue, 4 Apr 2006 10:00:55 -0400 In-Reply-To: <20060404134632.22093.qmail@webmail55.rediffmail.com> Subject: Re: Unable to connect to PostgreSQL Server: Permission denied To: "muralidhar sortur" Cc: "Javier Carlos" , "Gnanavel S" , "pgsql_php" X-Mailer: Lotus Notes Release 6.5.2 June 01, 2004 Message-ID: From: CGMoller@StateStreet.com Date: Tue, 4 Apr 2006 10:00:47 -0400 MIME-Version: 1.0 X-MIMETrack: Serialize by Router on mail37w/Mail/StateStreet(Release 6.5.4FP2|September 12, 2005) at 04/04/2006 10:00:55 AM, Itemize by SMTP Server on smtp03w/SRVC/StateStreet(Release 6.0.3|September 26, 2003) at 04/04/2006 10:00:55 AM, Serialize by Router on smtp03w/SRVC/StateStreet(Release 6.0.3|September 26, 2003) at 04/04/2006 10:00:56 AM Content-type: multipart/mixed; Boundary="0__=0ABBFBD5DFDF2A728f9e8a93df938690918c0ABBFBD5DFDF2A72" Content-Disposition: inline X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.55 required=5 tests=[NO_REAL_NAME=0.55] X-Spam-Score: 0.55 X-Spam-Level: X-Archive-Number: 200604/5 X-Sequence-Number: 3475 --0__=0ABBFBD5DFDF2A728f9e8a93df938690918c0ABBFBD5DFDF2A72 Content-type: text/plain; charset=US-ASCII Perhaps you or your host are running SE Linux?? Depending on your configuration, users may be forced to run personal websites out of their home directories. Cameron +++++++++++++++++++++++++++++++++++++ Cameron G. Moller, Senior Officer Technical Project Manager SSGM Infrastructure State Street Corporation ... __o Cell: 617-799-9049 ... -\<, Desk: 617-664-4501 ... (_)/(_) .. +++++++++++++++++++++++++++++++++++++ "muralidhar sortur" "Javier Carlos" Sent by: , "Gnanavel pgsql-php-owner@p S" , ostgresql.org "pgsql_php" cc 04/04/2006 09:46 AM Subject Re: [PHP] Unable to connect to PostgreSQL Server: Permission Please respond to denied "muralidhar sortur" Hi , in my last mail i forgot to mention that i have restarted apache server after making changes to the httpd.conf. Today i made one more experiment ... 1. changed httpd.conf user apache Group apache DocumentRoot="/home/murali/html" ......(as it is).... 2. copied the files add.html and add-entry.html to directory html under my home directory i.e /home/murali/html 3. restarted apache /usr/sbin/apachectl start ( from root) 4. from postgres login started postmaster. postmaster -i -D data& 5. http://localhost/add.html ( entered Name , Phone , Email) EVERY THING WORKED !!!!! BUT CAN ANY ONE TELL ME, WHAT WAS THE PROBLEM WITH EARLIER SETTING AND WHAT MADE IT TO WORK PROPERLY NOW !!! I NEED TO ANSWER THESE QUESTIONS Thanks for all of your help regards Muralidhar On Tue, 04 Apr 2006 Javier Carlos wrote : > Did you try to restart the PosgreSQL server using pg_ctl ? > >$ pg_ctl restart > > > Are you able to connect as user from the command line? > >$ psql AddressBook www > > Regards, > > Javier > > > > > > Hi , > > Here is the complete description of the problem ... > > > > I have newly installed fedora core 4 with option as everyting. > > > > it comes with apache webserver, postgresql , php-postgresql, php-gd etc, > > > > it creates a default user postgres with home = /var/lib/psql > > > > 1. i loged in as postgres > > > > 2. called initdb > > created database under directory ~/data > > > > 3. changed postgresql.conf to include > > listen_addresses = '*' > > port = 5432 > > > > 4. changed pg_hba.conf > > local all all trust > > host all all 127.0.0.1/32 trust > > host all all 192.168.1.18/24 trust > > host all all ::1/128 trust > > > > 5. postmaster -i -D ~/data & > > > > 6. createdb AddressBook > > > > 7. psql AddressBook > > > > 8. create table addresses( Name text, Phone text, Email text); > > > > 9. create user www NOCREATEDB NOCREATEUSER; > > > > 10. grant all on addresses to www; > > > > 11. from other terminal i loged in as root > > > > 12. changed /etc/httpd/conf/httpd.conf > > > > User www > > Group postgres > > > > 13. copied add.html and add-entry.php into directory /var/www/html > > > > add.html > > ------------------------------------------------------ > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Name
Phone
E-mail
> > > >
> >
> >
> > > > > > > > -------------------------------------------------- > > add-entry.php > > -------------------------------------------------- > > > > > > > > > $db = pg_Connect( "dbname=AddressBook user=www"); > > if( !$db ) > > { > > echo "Could not connect!"; > > exit; > > } > > > > $Name=$_GET['Name']; > > $Email=$_GET['Email']; > > $Phone=$_GET['Phone']; > > > > $query = "INSERT INTO Addresses VALUES( '$Name', '$Phone', '$Email' );"; > > > > $result = pg_Exec( $db, $query ); > > > > if( !$result ) > > { > > echo "No result set returned!"; > > exit; > > } > > > > $rows = pg_NumRows( $result ); > > > > if( $rows = 0 ) > > { > > echo "Add Failed."; > > exit; > > } > > > > $query = "SELECT * FROM Addresses WHERE \"Name\" = '$Name';"; > > > > $query = "SELECT * FROM Addresses WHERE \"Name\" = '$Name';"; > > > > $result = pg_Exec( $db, $query ); > > $row = pg_Fetch_Row( $result, 0 ); > > > > $nameResult = $row[0]; > > $phoneResult = $row[1]; > > $emailResult = $row[2]; > > > > echo "Name = $nameResult
"; > > echo "Phone = $phoneResult
"; > > echo "E-mail = $emailResult
"; > > > > pg_Close( $db ); > > ?> > > > >

Add Okay!

> > > > > > > > ------------------------------------------------------------- > > Error i get is > > Mon Apr 03 18:39:53 2006] [notice] Apache/2.0.54 (Fedora) configured -- > > resuming normal operations > > [Mon Apr 03 18:42:17 2006] [error] [client 127.0.0.1] File does not exist: > > /var/www/html/favicon.ico > > [client 127.0.0.1] PHP Warning: pg_connect() [ > href='function.pg-connect'>function.pg-connect]: Unable to connect to > > PostgreSQL server: could not connect to server: Permission denied\n\tIs > > the server running locally and accepting\n\tconnections on Unix domain > > socket "/tmp/.s.PGSQL.5432"? in /var/www/html/add-entry.php on > > line 5, referer: http://localhost/add.html > > [Mon Apr 03 18:42:22 2006] [error] [client 127.0.0.1] File does not exist: > > /var/www/html/favicon.ico > > > > _______________________________________________________ > > > > from the command line it works fine > > i.e php add-entry.php works fine ( ofcourse adds an empty row into the > > data base) > > > > -------------------------------------------------- > > > > i did telnet > > > > [root@localhost html]# telnet localhost 5432 > > Trying 127.0.0.1... > > Connected to localhost.localdomain (127.0.0.1). > > Escape character is '^]'. > > > > > > Connection closed by foreign host. > > > > data/pg_log/postgresql-Mon.log contains > > > > LOG: invalid length of startup packet > > > > > > > > ------------------------------- > > > > > > I am not getting any clue as to how to solve this problem ...let me know > > if you have any idea in solving this porblem. > > > > regards > > Muralidhar > > > > > > > > > >------------- >nediam.com.mx > > >---------------------------(end of broadcast)--------------------------- >TIP 5: don't forget to increase your free space map settings (Embedded image moved to file: pic14604.gif) --0__=0ABBFBD5DFDF2A728f9e8a93df938690918c0ABBFBD5DFDF2A72 Content-type: image/gif; name="pic14604.gif" Content-Disposition: attachment; filename="pic14604.gif" Content-Transfer-Encoding: base64 R0lGODlhQgImALMLAPCxq0I1JtGREpNpG+tjUOUrN/3xAcwGAAAAAP////+wD////wAAAAAAAAAA AAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFLAELACwAAAAAQgImAAAE//DIQ5IF8wCbyixcklVX tlmeBHIjh01n94VtCXPpsVp1QmShlyT2m9AmpIRQwylKjpLkMpbbiZAuE27GwtqGWxWUkr2huDyv UnsWd6NNYBlscR7GUrZPnoZ/mW06eHOAMm59ZH9UaFd+a2aGgm+Jj3SRVj12QXqak3mQnYifllV4 PVNhkqKEi4eNlK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X4GAqzQwO4tkp Zfi2K49VAhrrY20ZvoiRLlDwJEcqG1qRawJckkerGMLyBR6X3bnlHnd4xYcWfI3QB8aRxEWlbJGf AUrWmIndxwrLg07jm4kjzQzuNySdSxxNlY4lrtGZ7KmsQXaM+Zir6lAgsEEGOVPTvkcXlNgrMhXd bEujECPBjJf+/FAweDLzspoLa61ja6uCYRWNl/Q3AaxstXdylVpKqZ1Z5pHc3VyIaPdWyeqdfNax DjbK3GZOs82zKy9zZvPWh900nP+Ph1n3YZ+BbIoniF0fjKNESTP7An4drcifZ6tXrehEcpeYoJoC zjRWnJSR/rV+DZEpYKJhQf56oyjujBkrzTSzCziaGfRnYerOI8DFeI3B5Bh7+UPG9uBnz6SS2odf /nwdQVS7ztSHWSprzyENJoA/uo/pRj2m303QRWbLJhPDKcqZnqCaGeRCZ3dS1TYsIxwYOcOByTPW AVk1waAdC3iDcM2QYECdE8Vjf5GBoCg0Iir6TSyCriOhtHxGAVsF5IUvLIC62tWqmy1lJxp4yoOc Zp+tTQeEu5ubTuiQIxfZEE5zkNtUrCAVJUIFGk/MlE0qMz2qHOZr+xPOSepgtkHOAXF3HVJXxcIB NigqcRq1e+IW/TSSBXoNFlI84w91wQ1JPe8p2Cjbq2DIx4Dgohelsls1BPmVoLQDKJx4gSIH2YpS RcaQ2yCkVhzUpkXCQogxaJYiD7lJKzgyBpyUJKIAphRQ2u2UluTAJ1NpyVSC8jfFKCUszlFJrPSH lVgpJCbw1sdeOiIIpghmiAT4SWF64U8WNKYqkanMr7TBcGiJpjSnSc1qWvOa1ixmM/FgmWRucxy6 +eYnwinOcppTD6jh1jlRoMN1gqCd7lRmBAAAOw== --0__=0ABBFBD5DFDF2A728f9e8a93df938690918c0ABBFBD5DFDF2A72-- From asm@vlo.olsztyn.pl Tue Apr 4 18:00:04 2006 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id BAB0811F665C for ; Tue, 4 Apr 2006 15:00:04 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 53585-01 for ; Tue, 4 Apr 2006 14:59:49 -0300 (ADT) X-Greylist: delayed 00:23:49.623961 by SQLgrey- Received: from vlo.olsztyn.pl (tranquillity.vlo.olsztyn.pl [83.17.240.242]) by postgresql.org (Postfix) with ESMTP id 5B68A11F6901 for ; Tue, 4 Apr 2006 14:59:46 -0300 (ADT) Received: by vlo.olsztyn.pl (Postfix, from userid 1000) id A8D277F30; Tue, 4 Apr 2006 19:35:10 +0200 (CEST) Date: Tue, 4 Apr 2006 19:35:10 +0200 From: Pawel Bernat To: pgsql-php@postgresql.org Subject: Re: Unable to connect to PostgreSQL Server: Permission denied Message-ID: <20060404193510.A15256@vlo> References: <20060403170611.19617.qmail@webmail47.rediffmail.com> <20060403200123.GB9357@cthulhu.sdi.tpnet.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5i In-Reply-To: <20060403200123.GB9357@cthulhu.sdi.tpnet.pl>; from skoot@qi.pl on Mon, Apr 03, 2006 at 10:01:23PM +0200 X-Flush: asmleet X-Discalimer: Of course! X-Operating-System: unix 32bit i686 X-Opinion-About-Mailer: =?iso-8859-2?Q?Mutt_-_jedyny_s=B3uszny?= X-Opinion-About-Header-Reader: 313373 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200604/6 X-Sequence-Number: 3476 On Mon, Apr 03, 2006 at 10:01:23PM +0200, Mariusz Pękala wrote: > Telnet is not the best tool for binary protocols. > You may try netcat (nc), but anyway - this test is not significant > here. It doesn't matter here. > Don't let the untrusted parameters to go into query. Someone may call > your page like this: > http://example.com/add-entry.php?Email=a'); delete from Addresses; -- Nothing wrong will happen. Regards, -- Paweł Bernat; uselessness' lover; select''as email; Slowly and surely the unix crept up on the Nintendo user ... From skoot@qi.pl Tue Apr 4 21:21:52 2006 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 8808511F6297 for ; Tue, 4 Apr 2006 18:21:52 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 88746-05 for ; Tue, 4 Apr 2006 18:21:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from pb78.olsztyn.sdi.tpnet.pl. (pb78.olsztyn.sdi.tpnet.pl [213.76.235.78]) by postgresql.org (Postfix) with ESMTP id 52DC611F628C for ; Tue, 4 Apr 2006 18:21:48 -0300 (ADT) Received: (qmail 17450 invoked by uid 1000); 4 Apr 2006 23:26:32 +0200 Date: Tue, 4 Apr 2006 23:26:32 +0200 From: Mariusz =?iso-8859-2?Q?P=EAkala?= To: pgsql-php@postgresql.org Subject: Re: Unable to connect to PostgreSQL Server: Permission denied Message-ID: <20060404212632.GA9480@cthulhu.sdi.tpnet.pl> Mail-Followup-To: pgsql-php@postgresql.org References: <20060403170611.19617.qmail@webmail47.rediffmail.com> <20060403200123.GB9357@cthulhu.sdi.tpnet.pl> <20060404193510.A15256@vlo> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X1bOJ3K7DJ5YkBrT" Content-Disposition: inline In-Reply-To: <20060404193510.A15256@vlo> User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200604/7 X-Sequence-Number: 3477 --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2006-04-04 19:35:10 +0200 (Tue, Apr), Pawel Bernat wrote: > On Mon, Apr 03, 2006 at 10:01:23PM +0200, Mariusz P=EAkala wrote: > > Telnet is not the best tool for binary protocols. > > You may try netcat (nc), but anyway - this test is not significant > > here. > It doesn't matter here. Okay, you're saying my English isn't perfect ? :-) > > Don't let the untrusted parameters to go into query. Someone may call > > your page like this: > > http://example.com/add-entry.php?Email=3Da'); delete from Addresses; -- > Nothing wrong will happen. Why? Unless I really overlooked something, I would humbly disagree. 1) It is possible to put a few sql requests in one string. 2) Relying on 'magic_quotes_gpc' and *possible* addslashes() is a bad thing, IMHO. So, where is my mistake? --=20 No virus found in this outgoing message. Checked by "grep -i virus $MESSAGE" Trust me. --X1bOJ3K7DJ5YkBrT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFEMuSIIzblgXdKMIURAmHuAKCvMkJUzqQbvCrkNVEPlT3xGq6HgACfYiwz iU1v1U7K9P4FHVY/obk9ujg= =ZvWY -----END PGP SIGNATURE----- --X1bOJ3K7DJ5YkBrT--