pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Where can I get error messages?
8+ messages / 5 participants
[nested] [flat]

* Where can I get error messages?
@ 2002-08-28 03:51 dr_sad(surguttel) <dr_sad@surguttel.ru>
  2002-08-28 15:20 ` Re: Where can I get error messages? Jean-Luc Lachance <jllachan@nsd.ca>
  0 siblings, 1 reply; 8+ messages in thread

From: dr_sad(surguttel) @ 2002-08-28 03:51 UTC (permalink / raw)
  To: pgsql-php

I've installed Postgres 7.2.2 on Linux SuSE 8.0 Pro.
From other server (SuSE 8.0 Pro + Apache 2.0.39 + PHP 4.2.2) I'm trying
to get access to Postgres database, using PHP-script:

<html>
<body>
<? $db = pg_connect(...); ?>
</body>
</html>

I've no errors messages both in PHP log and Postgres console, but HTML
page was been generated this script are stoped on <body> tag. Where
can I get error messages? That is possible troubles?

Thank You

-- 
With respect, Andrey Sergeev




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

* Re: Where can I get error messages?
  2002-08-28 03:51 Where can I get error messages? dr_sad(surguttel) <dr_sad@surguttel.ru>
@ 2002-08-28 15:20 ` Jean-Luc Lachance <jllachan@nsd.ca>
  2002-08-29 03:57   ` Re: Where can I get error messages? dr_sad(surguttel) <dr_sad@surguttel.ru>
  2002-09-19 20:10   ` Re: Where can I get error messages? Miguel Carvalho <miguel@ipatimup.pt>
  0 siblings, 2 replies; 8+ messages in thread

From: Jean-Luc Lachance @ 2002-08-28 15:20 UTC (permalink / raw)
  To: dr_sad(surguttel) <dr_sad@surguttel.ru>; +Cc: pgsql-php

Why don't you use the DB::connect instead?

"dr_sad(surguttel)" wrote:
> 
> I've installed Postgres 7.2.2 on Linux SuSE 8.0 Pro.
> >From other server (SuSE 8.0 Pro + Apache 2.0.39 + PHP 4.2.2) I'm trying
> to get access to Postgres database, using PHP-script:
> 
> <html>
> <body>
> <? $db = pg_connect(...); ?>
> </body>
> </html>
> 
> I've no errors messages both in PHP log and Postgres console, but HTML
> page was been generated this script are stoped on <body> tag. Where
> can I get error messages? That is possible troubles?
> 
> Thank You
> 
> --
> With respect, Andrey Sergeev
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)



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

* Re: Where can I get error messages?
  2002-08-28 03:51 Where can I get error messages? dr_sad(surguttel) <dr_sad@surguttel.ru>
  2002-08-28 15:20 ` Re: Where can I get error messages? Jean-Luc Lachance <jllachan@nsd.ca>
@ 2002-08-29 03:57   ` dr_sad(surguttel) <dr_sad@surguttel.ru>
  2002-08-29 05:37     ` Re: Where can I get error messages? Keary Suska <hierophant@pcisys.net>
  2002-08-29 15:43     ` Re: Where can I get error messages? Jean-Luc Lachance <jllachan@nsd.ca>
  1 sibling, 2 replies; 8+ messages in thread

From: dr_sad(surguttel) @ 2002-08-29 03:57 UTC (permalink / raw)
  To: Jean-Luc Lachance <jllachan@nsd.ca>; +Cc: pgsql-php

Hi, Jean-Luc.
Can't find any documents about "DB::connect" at www.php.net :(
Give me please any links to that.
And why "pg_connect" does not work properly?
Script ex.:
---- cut ---------
<html>
<body>
<?
printf("Hello, world!<br>");
$s="host=dbserv port=5432 dbname=ll user=postgres password=gecnzr";
if (($db=pg_pconnect ($s))===false) {printf("FALSE! No connection!<br>");}
printf("This is the end of script<br>");
?>
</body>
</html>
--- cut -----------
No errors messages... "Hello, world!<br>" - is the last line in
generated html text :\

with respect, Andrey

Wednesday, August 28, 2002, 9:20:43 PM, you wrote:
JLL> Why don't you use the DB::connect instead?

JLL> "dr_sad(surguttel)" wrote:
>> 
>> I've installed Postgres 7.2.2 on Linux SuSE 8.0 Pro.
>> >From other server (SuSE 8.0 Pro + Apache 2.0.39 + PHP 4.2.2) I'm trying
>> to get access to Postgres database, using PHP-script:
>> 
>> <html>
>> <body>
>> <? $db = pg_connect(...); ?>
>> </body>
>> </html>
>> 
>> I've no errors messages both in PHP log and Postgres console, but HTML
>> page was been generated this script are stoped on <body> tag. Where
>> can I get error messages? That is possible troubles?
>> 
>> Thank You
>> 
>> --
>> With respect, Andrey Sergeev
>> 
>> ---------------------------(end of broadcast)---------------------------
>> TIP 2: you can get off all lists at once with the unregister command
>>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

JLL> ---------------------------(end of broadcast)---------------------------
JLL> TIP 4: Don't 'kill -9' the postmaster




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

* Re: Where can I get error messages?
  2002-08-28 03:51 Where can I get error messages? dr_sad(surguttel) <dr_sad@surguttel.ru>
  2002-08-28 15:20 ` Re: Where can I get error messages? Jean-Luc Lachance <jllachan@nsd.ca>
  2002-08-29 03:57   ` Re: Where can I get error messages? dr_sad(surguttel) <dr_sad@surguttel.ru>
@ 2002-08-29 05:37     ` Keary Suska <hierophant@pcisys.net>
  2002-08-29 12:57       ` Re: Where can I get error messages? Cornelia Boenigk <poppcorn@cornelia-boenigk.de>
  1 sibling, 1 reply; 8+ messages in thread

From: Keary Suska @ 2002-08-29 05:37 UTC (permalink / raw)
  To: pgsql-php

on 8/28/02 9:57 PM, dr_sad@surguttel.ru purportedly said:

> Hi, Jean-Luc.
> Can't find any documents about "DB::connect" at www.php.net :(
> Give me please any links to that.
> And why "pg_connect" does not work properly?
> Script ex.:
> ---- cut ---------
> <html>
> <body>
> <?
> printf("Hello, world!<br>");
> $s="host=dbserv port=5432 dbname=ll user=postgres password=gecnzr";
> if (($db=pg_pconnect ($s))===false) {printf("FALSE! No connection!<br>");}
> printf("This is the end of script<br>");
> ?>
> </body>
> </html>
> --- cut -----------
> No errors messages... "Hello, world!<br>" - is the last line in
> generated html text :\
> 

This would mean that something is interfering with PHP's standard error
reporting mechanism. Look for set_error_handler in any PHP code you invoke
and check your php.ini for any related directive, as well as any auto-append
or auto-prepend scripts if defined.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"




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

* Re: Where can I get error messages?
  2002-08-28 03:51 Where can I get error messages? dr_sad(surguttel) <dr_sad@surguttel.ru>
  2002-08-28 15:20 ` Re: Where can I get error messages? Jean-Luc Lachance <jllachan@nsd.ca>
  2002-08-29 03:57   ` Re: Where can I get error messages? dr_sad(surguttel) <dr_sad@surguttel.ru>
  2002-08-29 05:37     ` Re: Where can I get error messages? Keary Suska <hierophant@pcisys.net>
@ 2002-08-29 12:57       ` Cornelia Boenigk <poppcorn@cornelia-boenigk.de>
  0 siblings, 0 replies; 8+ messages in thread

From: Cornelia Boenigk @ 2002-08-29 12:57 UTC (permalink / raw)
  To: pgsql-php

Hi Andrey

> Can't find any documents about "DB::connect" at www.php.net :(
So check the pear-doku.

> And why "pg_connect" does not work properly?
You are using a persistent connection in your example, but anyway,
your code is working for me perfectly.
To get errormessages try out pg_last_error() or pg_result_error().

Regards
Conni






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

* Re: Where can I get error messages?
  2002-08-28 03:51 Where can I get error messages? dr_sad(surguttel) <dr_sad@surguttel.ru>
  2002-08-28 15:20 ` Re: Where can I get error messages? Jean-Luc Lachance <jllachan@nsd.ca>
  2002-08-29 03:57   ` Re: Where can I get error messages? dr_sad(surguttel) <dr_sad@surguttel.ru>
@ 2002-08-29 15:43     ` Jean-Luc Lachance <jllachan@nsd.ca>
  2002-08-30 06:26       ` Re: Where can I get error messages? dr_sad(surguttel) <dr_sad@surguttel.ru>
  1 sibling, 1 reply; 8+ messages in thread

From: Jean-Luc Lachance @ 2002-08-29 15:43 UTC (permalink / raw)
  To: dr_sad(surguttel) <dr_sad@surguttel.ru>; +Cc: pgsql-php

Here is a sample:

<html>
  <head>
    <title>PostgreSQL PHP Test</title>
  <body>
    <table>
    <?php
    require_once( 'DB.php');

    $userid=...;
    $password=...;
    $dbhost=...;
    $databse=...;

    $db = DB::connect( "pgsql://$userid:$password@$dbhost/$database");
    if( DB::iserror( $db))
      {
      die( "DB:connect " . $db->getMessage());
      }
 
    $sql = "select * from whatever";
    $q = $db->query($sql);
 
    if( DB::iserror( $q))
      {
      die( "Query " . $q->getMessage());
      }
 
    while( $row = $q->fetchRow( ))
      {
      ?>
      <tr><td><?= $row[0] ?> </td>
          <td><?= $row[1] ?> </td>
          <td><?= $row[2] ?> </td>
      </tr>
      <?php
      }
      ?>
     </table>
   </body>
</html>


Make sure that you include /usr/share/pear in the include_path in
php.ini and restart httpd.

JLL


"dr_sad(surguttel)" wrote:
> 
> Hi, Jean-Luc.
> Can't find any documents about "DB::connect" at www.php.net :(
> Give me please any links to that.
> And why "pg_connect" does not work properly?
> Script ex.:
> ---- cut ---------
> <html>
> <body>
> <?
> printf("Hello, world!<br>");
> $s="host=dbserv port=5432 dbname=ll user=postgres password=gecnzr";
> if (($db=pg_pconnect ($s))===false) {printf("FALSE! No connection!<br>");}
> printf("This is the end of script<br>");
> ?>
> </body>
> </html>
> --- cut -----------
> No errors messages... "Hello, world!<br>" - is the last line in
> generated html text :\
> 
> with respect, Andrey
> 
> Wednesday, August 28, 2002, 9:20:43 PM, you wrote:
> JLL> Why don't you use the DB::connect instead?
> 
> JLL> "dr_sad(surguttel)" wrote:
> >>
> >> I've installed Postgres 7.2.2 on Linux SuSE 8.0 Pro.
> >> >From other server (SuSE 8.0 Pro + Apache 2.0.39 + PHP 4.2.2) I'm trying
> >> to get access to Postgres database, using PHP-script:
> >>
> >> <html>
> >> <body>
> >> <? $db = pg_connect(...); ?>
> >> </body>
> >> </html>
> >>
> >> I've no errors messages both in PHP log and Postgres console, but HTML
> >> page was been generated this script are stoped on <body> tag. Where
> >> can I get error messages? That is possible troubles?
> >>
> >> Thank You
> >>
> >> --
> >> With respect, Andrey Sergeev
> >>
> >> ---------------------------(end of broadcast)---------------------------
> >> TIP 2: you can get off all lists at once with the unregister command
> >>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 
> JLL> ---------------------------(end of broadcast)---------------------------
> JLL> TIP 4: Don't 'kill -9' the postmaster



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

* Re: Where can I get error messages?
  2002-08-28 03:51 Where can I get error messages? dr_sad(surguttel) <dr_sad@surguttel.ru>
  2002-08-28 15:20 ` Re: Where can I get error messages? Jean-Luc Lachance <jllachan@nsd.ca>
  2002-08-29 03:57   ` Re: Where can I get error messages? dr_sad(surguttel) <dr_sad@surguttel.ru>
  2002-08-29 15:43     ` Re: Where can I get error messages? Jean-Luc Lachance <jllachan@nsd.ca>
@ 2002-08-30 06:26       ` dr_sad(surguttel) <dr_sad@surguttel.ru>
  0 siblings, 0 replies; 8+ messages in thread

From: dr_sad(surguttel) @ 2002-08-30 06:26 UTC (permalink / raw)
  To: Jean-Luc Lachance <jllachan@nsd.ca>; +Cc: pgsql-php

Sorry, but this sample doesn't work... :\
if I change phptype "pgsql" in DSN
(pgsql://$userid:$password@$dbhost/$database)
on "mysql", then get error message:"DB Error: connect failed", but
else if phptype=pqsql (as write in sample) nothing happyness and
result html code is:
<html>
    <head>
        <title>PostgreSQL PHP Test</title>
    </head>
    <body>
        <table>

-- 
Best wishes, Andrey

Thursday, August 29, 2002, 9:43:37 PM, you wrote:
JLL> Here is a sample:

JLL> <html>
JLL>   <head>
JLL>     <title>PostgreSQL PHP Test</title>
JLL>   <body>
JLL>     <table>
JLL>     <?php
JLL>     require_once( 'DB.php');

JLL>     $userid=...;
JLL>     $password=...;
JLL>     $dbhost=...;
JLL>     $databse=...;

JLL>     $db = DB::connect( "pgsql://$userid:$password@$dbhost/$database");
JLL>     if( DB::iserror( $db))
JLL>       {
JLL>       die( "DB:connect " . $db->getMessage());
JLL>       }
 
JLL>     $sql = "select * from whatever";
JLL>     $q = $db->query($sql);
 
JLL>     if( DB::iserror( $q))
JLL>       {
JLL>       die( "Query " . $q->getMessage());
JLL>       }
 
JLL>     while( $row = $q->fetchRow( ))
JLL>       {
JLL>       ?>
JLL>       <tr><td><?= $row[0] ?> </td>
JLL>           <td><?= $row[1] ?> </td>
JLL>           <td><?= $row[2] ?> </td>
JLL>       </tr>
JLL>       <?php
JLL>       }
JLL>       ?>
JLL>      </table>
JLL>    </body>
JLL> </html>


JLL> Make sure that you include /usr/share/pear in the include_path in
JLL> php.ini and restart httpd.

JLL> JLL


JLL> "dr_sad(surguttel)" wrote:
>> 
>> Hi, Jean-Luc.
>> Can't find any documents about "DB::connect" at www.php.net :(
>> Give me please any links to that.
>> And why "pg_connect" does not work properly?
>> Script ex.:
>> ---- cut ---------
>> <html>
>> <body>
>> <?
>> printf("Hello, world!<br>");
>> $s="host=dbserv port=5432 dbname=ll user=postgres password=gecnzr";
>> if (($db=pg_pconnect ($s))===false) {printf("FALSE! No connection!<br>");}
>> printf("This is the end of script<br>");
>> ?>
>> </body>
>> </html>
>> --- cut -----------
>> No errors messages... "Hello, world!<br>" - is the last line in
>> generated html text :\
>> 
>> with respect, Andrey
>> 
>> Wednesday, August 28, 2002, 9:20:43 PM, you wrote:
>> JLL> Why don't you use the DB::connect instead?
>> 
>> JLL> "dr_sad(surguttel)" wrote:
>> >>
>> >> I've installed Postgres 7.2.2 on Linux SuSE 8.0 Pro.
>> >> >From other server (SuSE 8.0 Pro + Apache 2.0.39 + PHP 4.2.2) I'm trying
>> >> to get access to Postgres database, using PHP-script:
>> >>
>> >> <html>
>> >> <body>
>> >> <? $db = pg_connect(...); ?>
>> >> </body>
>> >> </html>
>> >>
>> >> I've no errors messages both in PHP log and Postgres console, but HTML
>> >> page was been generated this script are stoped on <body> tag. Where
>> >> can I get error messages? That is possible troubles?
>> >>
>> >> Thank You
>> >>
>> >> --
>> >> With respect, Andrey Sergeev
>> >>
>> >> ---------------------------(end of broadcast)---------------------------
>> >> TIP 2: you can get off all lists at once with the unregister command
>> >>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>> 
>> JLL> ---------------------------(end of broadcast)---------------------------
>> JLL> TIP 4: Don't 'kill -9' the postmaster




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

* Re: Where can I get error messages?
  2002-08-28 03:51 Where can I get error messages? dr_sad(surguttel) <dr_sad@surguttel.ru>
  2002-08-28 15:20 ` Re: Where can I get error messages? Jean-Luc Lachance <jllachan@nsd.ca>
@ 2002-09-19 20:10   ` Miguel Carvalho <miguel@ipatimup.pt>
  1 sibling, 0 replies; 8+ messages in thread

From: Miguel Carvalho @ 2002-09-19 20:10 UTC (permalink / raw)
  To: jllachan@nsd.ca; +Cc: pgsql-php

> Why don't you use the DB::connect instead?
>
> "dr_sad(surguttel)" wrote:
>>
>> I've installed Postgres 7.2.2 on Linux SuSE 8.0 Pro.
>> >From other server (SuSE 8.0 Pro + Apache 2.0.39 + PHP 4.2.2) I'm
>> >trying
>> to get access to Postgres database, using PHP-script:

Can you login with the same user and password using pgsql?
Are the database server and webserver running on the same machine?

>>
>> <html>
>> <body>
>> <? $db = pg_connect(...); ?>
>> </body>
>> </html>
>>
>> I've no errors messages both in PHP log and Postgres console, but HTML
>> page was been generated this script are stoped on <body> tag. Where
>> can I get error messages? That is possible troubles?

If the script has stopped at pg_connect there are two things:
 - the database server isnt running
 - the password, login,machine ip you are using arent authorized to connect

Take a look at the log of postgres. For this, i hope you havent sent the
output of the postmaster to /dev/null.
Miguel







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


end of thread, other threads:[~2002-09-19 20:10 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-08-28 03:51 Where can I get error messages? dr_sad(surguttel) <dr_sad@surguttel.ru>
2002-08-28 15:20 ` Jean-Luc Lachance <jllachan@nsd.ca>
2002-08-29 03:57   ` dr_sad(surguttel) <dr_sad@surguttel.ru>
2002-08-29 05:37     ` Keary Suska <hierophant@pcisys.net>
2002-08-29 12:57       ` Cornelia Boenigk <poppcorn@cornelia-boenigk.de>
2002-08-29 15:43     ` Jean-Luc Lachance <jllachan@nsd.ca>
2002-08-30 06:26       ` dr_sad(surguttel) <dr_sad@surguttel.ru>
2002-09-19 20:10   ` Miguel Carvalho <miguel@ipatimup.pt>

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