Re: Cannot connect PostgreSQL 7.3.1. Using PHP thru...
| From: | H. Etzel | Date: | Sat, 15 Mar 2003 16:47:13 +0000 |
| Subject: | Re: Cannot connect PostgreSQL 7.3.1. Using PHP thru... | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-26394@lists.php.net to get a copy of this message | ||
Hi again,
I have got the same problem with phppgadmin on a unix system. But I found
out, that (with my configuration) you only can connect as user www-data.
I got the same problem in a perl-Skript.
But if I connect from a Windows-System with PgAdmin2 then I can connect as
everybody and without password?!?
I think the problem is in the pg_hba.conf.
I keep on trying, or is there anybody with an idea?
H.Etzel
H. Etzel wrote:
>> "Patrick Lok" <patricklok@msn.com> wrote in message
>> news:20030307100923.84342.qmail@pb1.pair.com...
>>> I have the following setups:
>>> *PostgreSql 7.3.1 and MSSQL on Win2k server (A)
>>> *Apache 1.3.x + PHP 4.3.1.1(using CGI & loaded w/ php_pgsql.dll) + ODBC
>> for
>>> PostgreSql v7.02.00.05 on Win2K server (B)
>>>
>>> I tried to use phppgadmin 2.4.2 and odbc for postgresql to connect
>>> PostgreSql in (A) but both connection failed!
>>>
>>> Can somebody give me some advices?
>>> Can PHP access remote DB server?
>>> Can ODBC for PostgreSql access remote DB server?
>>>
>>> Best regards
>>> ./pl
>>>
>>>
>>>
>>> Using PHPPGADMIN 2.4.2 to administer but it says "Wrong
>> username/password.
>>> Access denied".
>>>
>>> The following is logged on psqlodbc_xxxx.log:
>>> DSN info:
>>>
>>
>
DSN='PostgreSQL',server='192.168.1.16',port='5432',dbase='tet',user='adminis
>>> trator',passwd=''
>>>
>>>
onlyread='0',protocol='6.4',showoid='0',fakeoidindex='0',showsystable='0'
>>> conn_settings='',conn_encoding='OTHER'
>>> translation_dll='',translation_option=''
>>>
>>>
>>> I wrote a simple php program in (B) to connect to server (A) using odbc
>> for
>>> postgresql but the connection failed!
>>>
>>> <?php
>>> $rtn = odbc_connect("PostgreSql","administrator","");
>>> $cur=odbc_exec($rtn,"select d_base, high_jrnal from salfmsc");
>>> while(odbc_fetch_row($cur)){
>>> $fld1=odbc_result($cur,1);
>>> $fld2=odbc_result($cur,2);
>>> echo $fld1;
>>> echo ("-");
>>> echo $fld2;
>>> echo ("<p>");
>>> }
>>> echo odbc_close($rtn);
>>> ?>
>>>
>>> BUT Warning is returned.
>>> Warning: SQL error: Could not connect to the server; Could not connect
>>> to remote socket., SQL state 08001 in SQLConnect in
>>> d:\tmp\webcodetest\mstest.php on line 3
>>>
>>> The following is logged on psqlodbc_xxxx.log:
>>> DSN info:
>>>
>>
>
DSN='PostgreSql',server='192.168.1.16',port='5432',dbase='tet',user='adminis
>>> trator',passwd=''
>>>
>>>
onlyread='0',protocol='6.4',showoid='0',fakeoidindex='0',showsystable='0'
>>> conn_settings='',conn_encoding='OTHER'
>>> translation_dll='',translation_option=''
>>> conn = 15742608, PGAPI_Connect(DSN='PostgreSql', UID='teter',
>>> PWD='')
>>> Global Options: Version='07.02.0005', fetch=100, socket=4096,
>>> unknown_sizes=0, max_varchar_size=254, max_longvarchar_size=8190
>>> disable_optimizer=1, ksqo=1, unique_index=1,
>>> use_declarefetch=0
>>> text_as_longvarchar=1, unknowns_as_longvarchar=0,
>>> bools_as_char=1 NAMEDATALEN=64
>>> extra_systable_prefixes='dd_;', conn_settings=''
>>> conn_encoding='OTHER'
>>> CONN ERROR: func=PGAPI_Connect, desc='Error on CC_connect', errnum=101,
>>> errmsg='Could not connect to the server'
>>> ------------------------------------------------------------
>>> henv=15742552, conn=15742608, status=0, num_stmts=16
>>> sock=15753592, stmts=15761872, lobj_type=-999
>>> ---------------- Socket Info -------------------------------
>>> socket=-1, reverse=0, errornumber=4, errormsg='Could not
>> connect
>>> to remote socket.'
>>> buffer_in=15753664, buffer_out=15757768
>>> buffer_filled_in=0, buffer_filled_out=0, buffer_read_in=0
>>>
>>>