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--