Connecting PHP-based Application to Postgres-9.0.3

Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 18:05:45 von Rich Shepard

This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.

---1463811785-672725638-1302192345=:397
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII

I'm migrating our Web site to CMS Made Simple, it worked here with
postgres-8.4, but stopped working when I upgraded to postgres-9.0.0 (and I'm
now running 9.0.3). This is with php-5.2.17 on Slackware-13.1. I need help
since I don't know PHP or ADOdb.

/var/log/httpd/error_log shows:

[Tue Apr 05 16:45:39 2011] [error] [client 127.0.0.1] PHP Fatal error:
Attempt to connect to database cms on rshepard@localhost failed in
/var/www/htdocs/cmsms/lib/adodb.functions.php on line 85

I've attached a copy of that function.

So far the message I posted to the adodb mail list yesterday is the only
one there, and there's no response to my help request on the phplens
adodb-php Web forum.

Rich

---1463811785-672725638-1302192345=:397
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=adodb.functions.php
Content-Transfer-Encoding: BASE64
Content-ID:
Content-Description:
Content-Disposition: attachment; filename=adodb.functions.php

PD9waHANCg0KLyoqDQogKiBAcGFja2FnZSBDTVMNCiAqLw0KDQovKioNCiAq
IEEgbWV0aG9kIHRvIGluaXRpYWxpemUgdGhlIGNvbm5lY3Rpb24gd2l0aCB0
aGUgQ01TTVMgY29uZmlndXJlZCBkYXRhYmFzZS4NCiAqDQogKiBAaW50ZXJu
YWwNCiAqIEBhY2Nlc3MgcHJpdmF0ZQ0KICovDQpmdW5jdGlvbiBsb2FkX2Fk
b2RiKCkgDQp7DQogIGdsb2JhbCAkZ0NtczsNCiAgZ2xvYmFsICRBRE9EQl92
ZXJzOw0KICAkY29uZmlnID0mICRnQ21zLT5HZXRDb25maWcoKTsNCg0KCS8v
IEBUT0RPOiBSZW1vdmUgZGVwZW5kZW5jZSBvbiBQRUFSIGZvciBlcnJvciBo
YW5kbGluZwkNCglpZiAoJGNvbmZpZ1snZGVidWcnXSA9PSB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GFkb2RiX2Vycm9yKCRkYnR5cGUsICRmdW5jdGlvbl9wZXJmb3JtZWQs
ICRlcnJvcl9udW1iZXIsICRlcnJvcl9tZXNzYWdlLCAkaG9zdCwgJGRhdGFi
YXNlLCAmJGNvbm5lY3Rpb25fb2JqKQ0Kew0KCWlmKGZpbGVfZXhpc3RzKGNt
c19qb2luX3BhdGgoZGlybmFtZShDT05GSUdfRklMRV9MT0NBVElPTiksICdk
Yl9lcnJvci5odG1sJykpKQ0KCXsNCgkJaW5jbHVkZV9vbmNlIGNtc19qb2lu
X3BhdGgoZGlybmFtZShDT05GSUdfRklMRV9MT0NBVElPTiksICdkYl9lcnJv
ci5odG1sJyk7DQoJCWV4aXQ7DQoJfQ0KCWVsc2UNCgl7DQoJCWVjaG8gIjxz
dHJvbmc+RGF0YWJhc2UgQ29ubmVjdGlvbiBGYWlsZWQ8L3N0cm9uZz48YnIg
Lz4iOw0KCQllY2hvICJFcnJvcjogeyRlcnJvcl9tZXNzYWdlfSAoeyRlcnJv
cl9udW1iZXJ9KTxiciAvPiI7DQoJCWVjaG8gIkZ1bmN0aW9uIFBlcmZvcm1l
ZDogeyRmdW5jdGlvbl9wZXJmb3JtZWR9PGJyIC8+IjsNCgkJZWNobyAiSG9z
dC9EQjogeyRob3N0fS97JGRhdGFiYXNlfTxiciAvPiI7DQoJCWVjaG8gIkRh
dGFiYXNlIFR5cGU6IHskZGJ0eXBlfTxiciAvPiI7DQoJfQ0KfQ0KDQo/Pg0K

---1463811785-672725638-1302192345=:397
Content-Type: text/plain
Content-Disposition: inline
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable


--=20
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

---1463811785-672725638-1302192345=:397--

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 18:20:36 von Alan Hodgson

--Boundary-01=_VRenNPGiY8hV3Ep
Content-Type: text/plain;
charset="iso-8859-15"
Content-Transfer-Encoding: 7bit

On April 7, 2011, Rich Shepard wrote:
> /var/log/httpd/error_log shows:
>
> [Tue Apr 05 16:45:39 2011] [error] [client 127.0.0.1] PHP Fatal error:
> Attempt to connect to database cms on rshepard@localhost failed in
> /var/www/htdocs/cmsms/lib/adodb.functions.php on line 85

Can you connect to the database with psql using the same credentials? PHP
will use the same underlying postgresql library to connect.

--
The era of procrastination, of half-measures, of soothing and baffling
expedients, of delays, is coming to a close. In its place we are entering a
period of consequences.

--Boundary-01=_VRenNPGiY8hV3Ep
Content-Type: text/html;
charset="iso-8859-15"
Content-Transfer-Encoding: 7bit



On April 7, 2011, Rich Shepard <rshepard@appl-ecosys.com> wrote:


> /var/log/httpd/error_log shows:


>


> [Tue Apr 05 16:45:39 2011] [error] [client 127.0.0.1] PHP Fatal error:


> Attempt to connect to database cms on rshepard@localhost failed in


> /var/www/htdocs/cmsms/lib/adodb.functions.php on line 85



Can you connect to the database with psql using the same credentials? PHP will use the same underlying postgresql library to connect.



--


The era of procrastination, of half-measures, of soothing and baffling expedients, of delays, is coming to a close. In its place we are entering a period of consequences.


--Boundary-01=_VRenNPGiY8hV3Ep--

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 18:35:18 von Rich Shepard

On Thu, 7 Apr 2011, Alan Hodgson wrote:

> Can you connect to the database with psql using the same credentials? PHP
> will use the same underlying postgresql library to connect.

Alan,

If you mean can I as a user connect to that same database, the answer is
yes:

[rshepard@salmo ~]$ psql cms
psql (9.0.3)
Type "help" for help.

cms=# \d
List of relations
Schema | Name | Type | Owner
--------+-----------------------------------+----------+---- ------
public | cms_additional_htmlblob_users | table | rshepard
public | cms_additional_htmlblob_users_seq | sequence | rshepard
public | cms_additional_users | table | rshepard
public | cms_additional_users_seq | sequence | rshepard
public | cms_admin_bookmarks | table | rshepard
public | cms_admin_bookmarks_seq | sequence | rshepard
public | cms_admin_recent_pages | table | rshepard
public | cms_admin_recent_pages_seq | sequence | rshepard
public | cms_adminlog | table | rshepard
public | cms_content | table | rshepard
public | cms_content_props | table | rshepard
public | cms_content_props_seq | sequence | rshepard
public | cms_content_seq | sequence | rshepard
public | cms_crossref | table | rshepard
public | cms_css | table | rshepard
public | cms_css_assoc | table | rshepard
public | cms_css_seq | sequence | rshepard

etc.

So, what can I do here?

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 18:51:35 von Alan Hodgson

--Boundary-01=_XuenN+wmcyFAxfG
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable

On April 7, 2011, Rich Shepard wrote:
> On Thu, 7 Apr 2011, Alan Hodgson wrote:
> > Can you connect to the database with psql using the same credentials?=20
> > PHP will use the same underlying postgresql library to connect.
>=20
> Alan,
>=20
> If you mean can I as a user connect to that same database, the answer
> is yes:
>=20

What does your pg_hba.conf file contain?



=2D-=20
The era of procrastination, of half-measures, of soothing and baffling=20
expedients, of delays, is coming to a close. In its place we are entering a=
=20
period of consequencesâ€=A6

--Boundary-01=_XuenN+wmcyFAxfG
Content-Type: text/html;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable

html40/strict.dtd">
eight:400; font-style:normal;">

ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On April 7,=
2011, Rich Shepard <rshepard@appl-ecosys.com> wrote:


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> On Thu=
, 7 Apr 2011, Alan Hodgson wrote:


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> > C=
an you connect to the database with psql using the same credentials?


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> > P=
HP will use the same underlying postgresql library to connect.


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">>


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> Alan,<=
/p>

ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">>


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> If =
you mean can I as a user connect to that same database, the answer


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> is yes=
:


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">>


rgin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-u=
ser-state:0;">


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">What does y=
our pg_hba.conf file contain?


rgin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-u=
ser-state:0;">


rgin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-u=
ser-state:0;">


rgin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-u=
ser-state:0;">


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">--


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">The era of =
procrastination, of half-measures, of soothing and baffling expedients, of =
delays, is coming to a close. In its place we are entering a period of cons=
equencesâ€=A6


--Boundary-01=_XuenN+wmcyFAxfG--

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 18:56:35 von Bill Moran

In response to Rich Shepard :

> On Thu, 7 Apr 2011, Alan Hodgson wrote:
>
> > Can you connect to the database with psql using the same credentials? PHP
> > will use the same underlying postgresql library to connect.
>
> Alan,
>
> If you mean can I as a user connect to that same database, the answer is
> yes:
>
> [rshepard@salmo ~]$ psql cms
> psql (9.0.3)
> Type "help" for help.

This is incorrect.

The ADODB error message indicates that you are connecting to localhost
via TCP/IP. The default for psql when you don't specify a host is to
connect via unix domain socket. You're not testing the same thing.

See if
psql -h localhost cms
works.

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 19:13:31 von Rich Shepard

On Thu, 7 Apr 2011, Alan Hodgson wrote:

> What does your pg_hba.conf file contain?

Unmodified from the sample:

# TYPE DATABASE USER CIDR-ADDRESS METHOD

@remove-line-for-nolocal@# "local" is for Unix domain socket connections
only
@remove-line-for-nolocal@local all all
# IPv4 local connections:
host all all 127.0.0.1/32 @authmethod@
# IPv6 local connections:
host all all ::1/128 @authmethod@

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 19:15:29 von Rich Shepard

On Thu, 7 Apr 2011, Bill Moran wrote:

> The ADODB error message indicates that you are connecting to localhost via
> TCP/IP. The default for psql when you don't specify a host is to connect
> via unix domain socket. You're not testing the same thing.

Bill

Oh.

> See if
> psql -h localhost cms
> works.

Yes, it does:

[rshepard@salmo ~]$ psql -h localhost cms
psql (9.0.3)
Type "help" for help.

cms=#


Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 19:20:29 von Bill Moran

In response to Rich Shepard :

> On Thu, 7 Apr 2011, Bill Moran wrote:
>
> > The ADODB error message indicates that you are connecting to localhost via
> > TCP/IP. The default for psql when you don't specify a host is to connect
> > via unix domain socket. You're not testing the same thing.
>
> Bill
>
> Oh.
>
> > See if
> > psql -h localhost cms
> > works.
>
> Yes, it does:
>
> [rshepard@salmo ~]$ psql -h localhost cms
> psql (9.0.3)
> Type "help" for help.
>
> cms=#

Well, that blows my first theory out of the water ;)

Check the PG server logs, and consider increasing some logging levels
on the server. PG does some pretty good logging of failed connections
if you have the settings right.

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 19:35:42 von Rich Shepard

On Thu, 7 Apr 2011, Bill Moran wrote:

> Check the PG server logs, and consider increasing some logging levels on
> the server. PG does some pretty good logging of failed connections if you
> have the settings right.

Bill,

There was no logging. I looked at /usr/local/pgsql/data/postgresql.conf
and had no idea what should be changed (and to what values) to enable
appropriate logging to /var/log/messages (where syslog messages go). Please
advise.

Thanks,

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 19:42:05 von Alan Hodgson

--Boundary-01=_tdfnN9J3pMROm6Z
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable

On April 7, 2011, Rich Shepard wrote:
> On Thu, 7 Apr 2011, Alan Hodgson wrote:
> > What does your pg_hba.conf file contain?
>=20
> Unmodified from the sample:
>=20
> # TYPE DATABASE USER CIDR-ADDRESS METHOD
>=20
> @remove-line-for-nolocal@# "local" is for Unix domain socket connections
> only
> @remove-line-for-nolocal@local all all
> # IPv4 local connections:
> host all all 127.0.0.1/32 =20
> @authmethod@ # IPv6 local connections:
> host all all ::1/128 =20
> @authmethod@
>=20
> Rich

What is @authmethod@? That looks like a substitution parameter from=20
something?

The default that should be in there is I think ident, which probably allows=
=20
you to access it as rshepard but not the web server to do so, which is=20
running under a different user.

Try changing the auth method on 127.0.0.1/32 to trust (just for testing),=
=20
and then if that works set it to md5 and assign a password.

=2D-=20
The era of procrastination, of half-measures, of soothing and baffling=20
expedients, of delays, is coming to a close. In its place we are entering a=
=20
period of consequencesâ€=A6

--Boundary-01=_tdfnN9J3pMROm6Z
Content-Type: text/html;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable

html40/strict.dtd">
eight:400; font-style:normal;">

ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On April 7,=
2011, Rich Shepard <rshepard@appl-ecosys.com> wrote:


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> On Thu=
, 7 Apr 2011, Alan Hodgson wrote:


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> > W=
hat does your pg_hba.conf file contain?


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">>


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> Unm=
odified from the sample:


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">>


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> # TYPE=
DATABASE USER CIDR-ADDRESS METHOD


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">>


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> @remov=
e-line-for-nolocal@# "local" is for Unix domain socket connection=
s


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> only p>

ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> @remov=
e-line-for-nolocal@local all all


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> # IPv4=
local connections:


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> host =
all all 127.0.0.1/32


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> @authm=
ethod@ # IPv6 local connections:


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> host =
all all ::1/128


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> @authm=
ethod@


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">>


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> Rich p>

rgin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-u=
ser-state:0;">


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">What is @au=
thmethod@? That looks like a substitution parameter from something?


rgin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-u=
ser-state:0;">


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">The default=
that should be in there is I think ident, which probably allows you to acc=
ess it as rshepard but not the web server to do so, which is running under =
a different user.


rgin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-u=
ser-state:0;">


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Try changin=
g the auth method on 127.0.0.1/32 to trust (just for testing), and then if=
that works set it to md5 and assign a password.


rgin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-u=
ser-state:0;">


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">--


ht:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">The era of =
procrastination, of half-measures, of soothing and baffling expedients, of =
delays, is coming to a close. In its place we are entering a period of cons=
equencesâ€=A6


--Boundary-01=_tdfnN9J3pMROm6Z--

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 19:52:46 von Rich Shepard

On Thu, 7 Apr 2011, Alan Hodgson wrote:

> What is @authmethod@? That looks like a substitution parameter from
> something?

Alan,

Oops! Copied tail of wrong file. It's not at the end of
/usr/local/pgsql/data/pg_hba.conf. That has:

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust

> Try changing the auth method on 127.0.0.1/32 to trust (just for testing),
> and then if that works set it to md5 and assign a password.

That's what it is: trust.

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 19:56:02 von Brian Fehrle

In the postgresql.conf file, look for these parameters.

log_destination (can be set to stderr, csvlog, syslog, and eventlog, you
probably want syslog).
log_connections (default is off, turn this on to see all connection
attempts to the database)
log_disconnections (same as log_connections)

These should let you see the connection information from the perspective
of the database.

- Brian F

Consistent State


On 04/07/2011 11:35 AM, Rich Shepard wrote:
> On Thu, 7 Apr 2011, Bill Moran wrote:
>
>> Check the PG server logs, and consider increasing some logging levels on
>> the server. PG does some pretty good logging of failed connections
>> if you
>> have the settings right.
>
> Bill,
>
> There was no logging. I looked at /usr/local/pgsql/data/postgresql.conf
> and had no idea what should be changed (and to what values) to enable
> appropriate logging to /var/log/messages (where syslog messages go).
> Please
> advise.
>
> Thanks,
>
> Rich
>


--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 20:17:49 von Rich Shepard

On Thu, 7 Apr 2011, Brian Fehrle wrote:

> In the postgresql.conf file, look for these parameters.
>
> log_destination (can be set to stderr, csvlog, syslog, and eventlog, you
> probably want syslog).
> log_connections (default is off, turn this on to see all connection attempts
> to the database)
> log_disconnections (same as log_connections)

Brian,

Hmm-m-m.

log_destination = 'syslog' # Valid values are combinations of
# stderr, csvlog, syslog, and eventlog,
# depending on platform. csvlog
# requires logging_collector to be on.
log_connections = on
log_disconnections = on

Yet, there's noting in /var/log/messages after restarting postgres.

Apr 7 11:13:14 salmo postgres[6652]: [1-1] LOG: database system is ready
to accept connections
Apr 7 11:13:14 salmo postgres[6656]: [1-1] LOG: autovacuum launcher
started

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 20:58:26 von Brian Fehrle

If nothing is appearing in the log after a restart and new connection
attempts, that makes me think that the database isn't even receiving the
connection attempt, which would mean either wrong connection credentials
or something blocking it in between (since it looks like it's an app on
the same machine as the database, that's most likely not it.

I'd verify that the full connection string is correct, host, port, user,
and database name. Connect with psql like you did before, but specify
all the parameters:
psql -h localhost -p -U
and if it works, make sure it's the same information in the
configuration for your application.

Also, this may help:
http://forum.cmsmadesimple.org/viewtopic.php?t=53350&p=25133 6 as it
mentions something about changing postgres7 to just postgres in the
config.php file.

- Brian F

Consistent State

On 04/07/2011 12:17 PM, Rich Shepard wrote:
> On Thu, 7 Apr 2011, Brian Fehrle wrote:
>
>> In the postgresql.conf file, look for these parameters.
>>
>> log_destination (can be set to stderr, csvlog, syslog, and eventlog,
>> you probably want syslog).
>> log_connections (default is off, turn this on to see all connection
>> attempts to the database)
>> log_disconnections (same as log_connections)
>
> Brian,
>
> Hmm-m-m.
>
> log_destination = 'syslog' # Valid values are
> combinations of
> # stderr, csvlog, syslog, and
> eventlog,
> # depending on platform. csvlog
> # requires logging_collector
> to be on.
> log_connections = on
> log_disconnections = on
>
> Yet, there's noting in /var/log/messages after restarting postgres.
>
> Apr 7 11:13:14 salmo postgres[6652]: [1-1] LOG: database system is
> ready
> to accept connections
> Apr 7 11:13:14 salmo postgres[6656]: [1-1] LOG: autovacuum launcher
> started
>
> Rich
>


--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 20:59:57 von Brian Fehrle

Um, strike that link, just looked at the name and realized who posted
that message.

doh.

On 04/07/2011 12:17 PM, Rich Shepard wrote:
> On Thu, 7 Apr 2011, Brian Fehrle wrote:
>
>> In the postgresql.conf file, look for these parameters.
>>
>> log_destination (can be set to stderr, csvlog, syslog, and eventlog,
>> you probably want syslog).
>> log_connections (default is off, turn this on to see all connection
>> attempts to the database)
>> log_disconnections (same as log_connections)
>
> Brian,
>
> Hmm-m-m.
>
> log_destination = 'syslog' # Valid values are
> combinations of
> # stderr, csvlog, syslog, and
> eventlog,
> # depending on platform. csvlog
> # requires logging_collector
> to be on.
> log_connections = on
> log_disconnections = on
>
> Yet, there's noting in /var/log/messages after restarting postgres.
>
> Apr 7 11:13:14 salmo postgres[6652]: [1-1] LOG: database system is
> ready
> to accept connections
> Apr 7 11:13:14 salmo postgres[6656]: [1-1] LOG: autovacuum launcher
> started
>
> Rich
>


--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 20:59:57 von Rich Shepard

On Thu, 7 Apr 2011, Brian Fehrle wrote:

> These should let you see the connection information from the perspective
> of the database.

Ah, I was looking at the wrong log file. Messages are in
/var/log/httpd/error_log:

[Thu Apr 07 11:13:43 2011] [error] [client 127.0.0.1] File does not exist:
/srv/httpd/htdocs/cms
[Thu Apr 07 11:51:11 2011] [error] [client 127.0.0.1] File does not exist:
/srv/httpd/htdocs/cms

From the access_log:

127.0.0.1 - - [07/Apr/2011:11:13:43 -0700] "GET /cms/index.php HTTP/1.1" 404 211
127.0.0.1 - - [07/Apr/2011:11:51:11 -0700] "GET /cms/index.php HTTP/1.1" 404 211

Yet:

drwxr-xr-x 11 rshepard users 4096 Apr 5 16:45 cmsms/

and:

I do see the Joomla-R-Us page, but neither a green "OK" nor an error
message; just the page with the script

-rwxr-xr-x 1 rshepard users 22077 Apr 7 09:54 postgresql.php

127.0.0.1 - - [07/Apr/2011:11:54:56 -0700] "GET /postgresql.php HTTP/1.1" 200 220

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 21:06:29 von Brian Fehrle

Is it trying to access /srv/httpd/htdocs/cms/ but your directory is at
/srv/httpd/htdocs/cmsms/ by chance?



On 04/07/2011 12:59 PM, Rich Shepard wrote:
> On Thu, 7 Apr 2011, Brian Fehrle wrote:
>
>> These should let you see the connection information from the perspective
>> of the database.
>
> Ah, I was looking at the wrong log file. Messages are in
> /var/log/httpd/error_log:
>
> [Thu Apr 07 11:13:43 2011] [error] [client 127.0.0.1] File does not
> exist:
> /srv/httpd/htdocs/cms
> [Thu Apr 07 11:51:11 2011] [error] [client 127.0.0.1] File does not
> exist:
> /srv/httpd/htdocs/cms
>
> From the access_log:
>
> 127.0.0.1 - - [07/Apr/2011:11:13:43 -0700] "GET /cms/index.php
> HTTP/1.1" 404 211
> 127.0.0.1 - - [07/Apr/2011:11:51:11 -0700] "GET /cms/index.php
> HTTP/1.1" 404 211
>
> Yet:
>
> drwxr-xr-x 11 rshepard users 4096 Apr 5 16:45 cmsms/
>
> and:
>
> I do see the Joomla-R-Us page, but neither a green "OK" nor an error
> message; just the page with the script
>
> -rwxr-xr-x 1 rshepard users 22077 Apr 7 09:54 postgresql.php
>
> 127.0.0.1 - - [07/Apr/2011:11:54:56 -0700] "GET /postgresql.php
> HTTP/1.1" 200 220
>
> Rich
>


--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 22:00:58 von Rich Shepard

On Thu, 7 Apr 2011, Brian Fehrle wrote:

> Also, this may help:
> http://forum.cmsmadesimple.org/viewtopic.php?t=53350&p=25133 6 as it
> mentions something about changing postgres7 to just postgres in the
> config.php file.

Brian,

Yep. That's my thread and my statement that I changed postgres7 to
postgres.

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 22:10:00 von Rich Shepard

On Thu, 7 Apr 2011, Brian Fehrle wrote:

> Is it trying to access /srv/httpd/htdocs/cms/ but your directory is at
> /srv/httpd/htdocs/cmsms/ by chance?

Brian,

I can see where I may have mis-typed the directory. It is
/srv/httpd/htdocs/cmsms/ and now I see in /var/log/httpd/error_log:

[Thu Apr 07 13:05:39 2011] [error] [client 127.0.0.1] PHP Fatal error:
Attempt to connect to database cms on rshepard@localhost failed in
/var/www/htdocs/cmsms/lib/adodb.functions.php on line 88

The error had been on line 85 before. And the access_log still shows an
internal server error:

127.0.0.1 - - [07/Apr/2011:13:05:39 -0700] "GET /cmsms/index.php HTTP/1.1"
500

It is quite frustrating. And I appreciate your help, and that of everyone
else.

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 22:25:55 von Rich Shepard

On Thu, 7 Apr 2011, Rich Shepard wrote:

> The error had been on line 85 before. And the access_log still shows an
> internal server error:

That's an artifact of lines wrapping. Same error.

To clarify: the application directory on the Web server is
/var/www/htdocs/cmsms (a.k.a. /srv/htdocs/cmsms). The name of the database
in postgres is cms. I turned on the page display in config.php so now I see
the error there:

Fatal error: Attempt to connect to database cms on rshepard@localhost failed
in /var/www/htdocs/cmsms/lib/adodb.functions.php on line 87

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 22:39:40 von Rod

On 07/04/2011 21:25, Rich Shepard wrote:
> On Thu, 7 Apr 2011, Rich Shepard wrote:
>
>> The error had been on line 85 before. And the access_log still shows an
>> internal server error:
>
> That's an artifact of lines wrapping. Same error.
>
> To clarify: the application directory on the Web server is
> /var/www/htdocs/cmsms (a.k.a. /srv/htdocs/cmsms). The name of the database
> in postgres is cms. I turned on the page display in config.php so now I see
> the error there:
>
> Fatal error: Attempt to connect to database cms on rshepard@localhost
> failed
> in /var/www/htdocs/cmsms/lib/adodb.functions.php on line 87

Have you located the Postgres log yet? ISTM that that's where you need
to be looking.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 22:51:43 von DCarrero

I think is better wait the response of Adodb Forum[1], but look the
adodb5\drivers\ directory, I downloaded and here we have this files:

adodb-postgres64.inc.php
adodb-postgres7.inc.php
adodb-postgres8.inc.php

Nothing about postgres9 :D

I hope you can find the solution CMS Made Simple is a great tool and Adodb too.


Greetings.

[1] http://phplens.com/lens/lensforum/msgs.php?id=18852

2011/4/7 Raymond O'Donnell :
> On 07/04/2011 21:25, Rich Shepard wrote:
>>
>> On Thu, 7 Apr 2011, Rich Shepard wrote:
>>
>>> The error had been on line 85 before. And the access_log still shows an
>>> internal server error:
>>
>> That's an artifact of lines wrapping. Same error.
>>
>> To clarify: the application directory on the Web server is
>> /var/www/htdocs/cmsms (a.k.a. /srv/htdocs/cmsms). The name of the database
>> in postgres is cms. I turned on the page display in config.php so now I
>> see
>> the error there:
>>
>> Fatal error: Attempt to connect to database cms on rshepard@localhost
>> failed
>> in /var/www/htdocs/cmsms/lib/adodb.functions.php on line 87
>
> Have you located the Postgres log yet? ISTM that that's where you need to be
> looking.
>
> Ray.
>
> --
> Raymond O'Donnell :: Galway :: Ireland
> rod@iol.ie
>
> --
> Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-php
>



--
Daniel Carrero Canales
Analista programador de sistemas
+56974726453
http://www.kode.cl

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 07.04.2011 22:59:23 von Rod

On 07/04/2011 21:51, Daniel Carrero wrote:
> I think is better wait the response of Adodb Forum[1], but look the
> adodb5\drivers\ directory, I downloaded and here we have this files:
>
> adodb-postgres64.inc.php
> adodb-postgres7.inc.php
> adodb-postgres8.inc.php
>
> Nothing about postgres9 :D

Without having seen the PG log, my guess is that that's where the
problem lies... I'll guess a bit more and say that maybe it's the
different handling of bytea columns.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 00:02:13 von Rich Shepard

On Thu, 7 Apr 2011, Raymond O'Donnell wrote:

> Have you located the Postgres log yet? ISTM that that's where you need to
> be looking.

Ray,

Yes ... and no. I think that I turned on all the right switches in
postgresql.conf, but the logging is displayed to stdout rather than to
syslog. I have a /var/log/postgresql but that has a few entries from last
December and nothing since. I can post the .conf file to learn what I set
incorrectly (or didn't set when it should be).

I also changed bytea_encoding to 'escape' from 'hex', stopped and
restarted the postmaster, and there's no change.

In C and python I'd be putting little stub code to print in the function
with the problems so I can tell just where I am when it fails. I've no idea
of how to do this in php, or where it would be appropriate to insert code to
generate diagnostics.

Thanks,

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 00:05:27 von Rich Shepard

On Thu, 7 Apr 2011, Daniel Carrero wrote:

> I think is better wait the response of Adodb Forum[1], but look the
> adodb5\drivers\ directory, I downloaded and here we have this files:
>
> adodb-postgres64.inc.php
> adodb-postgres7.inc.php
> adodb-postgres8.inc.php
>
> Nothing about postgres9 :D

Daniel,

There does not seem to be much activity on that forum. Everyone here has
been much more responsive.

> I hope you can find the solution CMS Made Simple is a great tool and Adodb too.

I decided on CMS Made Simple because it's the only CMS that works for a
fairly static site and supports postgres as well as mysql. All the others
are hard-coded to mysql for reasons I cannot understand.

Thanks,

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 00:08:56 von Rich Shepard

On Thu, 7 Apr 2011, Daniel Carrero wrote:

> adodb-postgres64.inc.php
> adodb-postgres7.inc.php
> adodb-postgres8.inc.php
> Nothing about postgres9 :D

Rod may be right. I don't seem to have any of these here:

[root@salmo /usr/local/pgsql/data]# find / -name adodb*php
/var/www/htdocs/cmsms/lib/adodb.functions.php
/var/www/htdocs/cmsms/lib/adodb_lite/lang/adodb-en.inc.php
/var/www/htdocs/cmsms/lib/adodb_lite/adodb-xmlschema.inc.php
/var/www/htdocs/cmsms/lib/adodb_lite/adodb-time.inc.php
/var/www/htdocs/cmsms/lib/adodb_lite/adodb.config.php
/var/www/htdocs/cmsms/lib/adodb_lite/adodb-exceptions.inc.ph p
/var/www/htdocs/cmsms/lib/adodb_lite/adodb-errorpear.inc.php
/var/www/htdocs/cmsms/lib/adodb_lite/adodb-error.inc.php
/var/www/htdocs/cmsms/lib/adodb_lite/adodb-datadict.inc.php
/var/www/htdocs/cmsms/lib/adodb_lite/adodb.inc.php
/var/www/htdocs/cmsms/lib/adodb_lite/adodb-errorhandler.inc. php
/opt/lib/adodb_lite/adodb-exceptions.inc.php
/opt/lib/adodb_lite/lang/adodb-en.inc.php
/opt/lib/adodb_lite/adodb-time.inc.php
/opt/lib/adodb_lite/adodb-errorhandler.inc.php
/opt/lib/adodb_lite/adodb.inc.php
/opt/lib/adodb_lite/adodb-error.inc.php
/opt/lib/adodb_lite/adodb.config.php
/opt/lib/adodb_lite/adodb-datadict.inc.php
/opt/lib/adodb_lite/adodb-xmlschema.inc.php
/opt/lib/adodb_lite/adodb-errorpear.inc.php
/opt/lib/adodb.functions.php

[root@salmo /usr/local/pgsql/data]# find / -name adodb-postgres*
[root@salmo /usr/local/pgsql/data]#

Where might I get the adodb-postgres*.inc.php?

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 00:19:43 von Rod

On 07/04/2011 23:02, Rich Shepard wrote:
> On Thu, 7 Apr 2011, Raymond O'Donnell wrote:
>
>> Have you located the Postgres log yet? ISTM that that's where you need to
>> be looking.
>
> Ray,
>
> Yes ... and no. I think that I turned on all the right switches in
> postgresql.conf, but the logging is displayed to stdout rather than to
> syslog. I have a /var/log/postgresql but that has a few entries from last
> December and nothing since. I can post the .conf file to learn what I set
> incorrectly (or didn't set when it should be).

Hi Rich,

That is a bit odd. Yes, please do post the relevant bits of the .conf -
clearer heads than mine may spot something.

What platform are you on (maybe you said already, and I missed it)? How
did you install PostgreSQL?

> In C and python I'd be putting little stub code to print in the function
> with the problems so I can tell just where I am when it fails. I've no idea
> of how to do this in php, or where it would be appropriate to insert
> code to
> generate diagnostics.

I think you've already got all the diagnostics you're going to get from
the PHP side of things... there are PHP functions to get the most recent
error from the Postgres connection, but it sounds as though the
connection isn't getting made in the first place (which of course
negates my upthread guess about bytea... doh).

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 00:51:27 von Rich Shepard

On Thu, 7 Apr 2011, Raymond O'Donnell wrote:

> That is a bit odd. Yes, please do post the relevant bits of the .conf -
> clearer heads than mine may spot something.

Ray,

#----------------------------------------------------------- -------------------
# ERROR REPORTING AND LOGGING
#----------------------------------------------------------- -------------------

# - Where to Log -

log_destination = 'syslog' # Valid values are combinations of
# stderr, csvlog, syslog, and eventlog,
# depending on platform. csvlog
# requires logging_collector to be on.

# This is used when logging to stderr:
logging_collector = on # Enable capturing of stderr and csvlog
# into log files. Required to be on for
# csvlogs.
# (change requires restart)

# These are only used if logging_collector is on:
#log_directory = 'pg_log' # directory where log files are written,
# can be absolute or relative to PGDATA
#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
# can include strftime() escapes
#log_truncate_on_rotation = off # If on, an existing log file of the
# same name as the new log file will be
# truncated rather than appended to.
# But such truncation only occurs on
# time-driven rotation, not on restarts
# or size-driven rotation. Default is
# off, meaning append to existing files
# in all cases.
log_rotation_age = 1d # Automatic rotation of logfiles will
# happen after that time. 0 disables.
log_rotation_size = 10MB # Automatic rotation of logfiles will
# happen after that much log output.
# 0 disables.

# These are relevant when logging to syslog:
syslog_facility = 'LOCAL0'
syslog_ident = 'postgres'

silent_mode = off # Run server silently.
# DO NOT USE without syslog or
# logging_collector
# (change requires restart)


# - When to Log -

#client_min_messages = notice # values in order of decreasing detail:
client_min_messages = debug5 # debug5
# debug4
# debug3
# debug2
# debug1
# log
# notice
# warning
# error

#log_min_messages = warning # values in order of decreasing detail:
log_min_messages = debug5 # debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic

#log_min_error_statement = error # values in order of decreasing detail:
log_min_error_statement = debug5 # debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic (effectively off)

#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
# and their durations, > 0 logs only
# statements running at least this number
# of milliseconds


# - What to Log -

#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = on
#log_checkpoints = off
log_connections = on
log_disconnections = on
#log_duration = off
log_error_verbosity = verbose # terse, default, or verbose messages
#log_hostname = off
#log_line_prefix = '' # special values:
# %a = application name
# %u = user name
# %d = database name
# %r = remote host and port
# %h = remote host
# %p = process ID
# %t = timestamp without milliseconds
# %m = timestamp with milliseconds
# %i = command tag
# %e = SQL state
# %c = session ID
# %l = session line number
# %s = session start timestamp
# %v = virtual transaction ID
# %x = transaction ID (0 if none)
# %q = stop here in non-session
# processes
# %% = '%'
# e.g. '<%u%%%d> '
#log_lock_waits = off # log lock waits >= deadlock_timeout
#log_statement = 'none' # none, ddl, mod, all
#log_temp_files = -1 # log temporary files equal or larger
# than the specified size in kilobytes;
# -1 disables, 0 logs all temp files
#log_timezone = unknown # actually, defaults to TZ environment
# setting

> What platform are you on (maybe you said already, and I missed it)? How did
> you install PostgreSQL?

Slackware-13.1/32-bit (soon to be upgraded to -13.37/64-bit). The
SlackBuild script did not want to work for me so I built with the usual
../configure; make; make install.

> I think you've already got all the diagnostics you're going to get from
> the PHP side of things... there are PHP functions to get the most recent
> error from the Postgres connection, but it sounds as though the connection
> isn't getting made in the first place (which of course negates my upthread
> guess about bytea... doh).

I think that's the problem. When I configured php I specified pgsql and
removed mysql, yet I don't see this database listed in the phpinfo output
nor do I have the libraries when I try to 'find' them. This may be the key.
I can send the php configure options, too.

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 01:20:34 von Rich Shepard

On Thu, 7 Apr 2011, Jose Luis Salcedo wrote:

> Hello guys, I think the best way to know what's happenning with the
> connection is make a file that try to connect with the simple instructions
> that provide php itself, if the simple connection works it means the problem
> is with the ADODB library, otherwise will be the database server.

Jose,

Mea culpa! I forgot to turn on the executable bits for test.php. When I
did nothing appears on the browser but /var/log/httpd/access_log has:

127.0.0.1 - - [07/Apr/2011:16:17:53 -0700] "GET /test.php HTTP/1.1" 200 192

So, if the issue is with adodb is it missing a driver or something else?

Thanks,

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 14:53:06 von Matthias Ritzkowski

Put a couple of print "Line is xyz" statements into test.php to see
where it fails ...
That non-existent adodb library for postgres 9.x would make this a
strong candidate to revert to 8.4. Why do you need cutting edge
postgres for a cms?

On 4/7/11, Rich Shepard wrote:
> On Thu, 7 Apr 2011, Jose Luis Salcedo wrote:
>
>> Hello guys, I think the best way to know what's happenning with the
>> connection is make a file that try to connect with the simple instructions
>> that provide php itself, if the simple connection works it means the
>> problem
>> is with the ADODB library, otherwise will be the database server.
>
> Jose,
>
> Mea culpa! I forgot to turn on the executable bits for test.php. When I
> did nothing appears on the browser but /var/log/httpd/access_log has:
>
> 127.0.0.1 - - [07/Apr/2011:16:17:53 -0700] "GET /test.php HTTP/1.1" 200 192
>
> So, if the issue is with adodb is it missing a driver or something else?
>
> Thanks,
>
> Rich
>
> --
> Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-php
>

--
Sent from my mobile device

Regards
Matthias Ritzkowski

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 15:17:09 von Rod

On 07/04/2011 23:51, Rich Shepard wrote:
> On Thu, 7 Apr 2011, Raymond O'Donnell wrote:
>
>> That is a bit odd. Yes, please do post the relevant bits of the .conf -
>> clearer heads than mine may spot something.
>
> Ray,
>
> #----------------------------------------------------------- -------------------
>
> # ERROR REPORTING AND LOGGING
> #----------------------------------------------------------- -------------------
>
>
> # - Where to Log -
>
> log_destination = 'syslog' # Valid values are combinations of
> # stderr, csvlog, syslog, and eventlog,
> # depending on platform. csvlog
> # requires logging_collector to be on.
>
> # This is used when logging to stderr:
> logging_collector = on # Enable capturing of stderr and csvlog
> # into log files. Required to be on for
> # csvlogs.
> # (change requires restart)
>
> # These are only used if logging_collector is on:
> #log_directory = 'pg_log' # directory where log files are written,
> # can be absolute or relative to PGDATA
> #log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
> # can include strftime() escapes

That all looks fine.... I seem to remember from upthread that you were
looking for logging output in /var/log/messages, but syslog output
should be in /var/log/syslog (on my Debian system anyway).

Also, from the above, look in the pg_log directory under the data
directory for any log files that might get written there.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3[UPDATE]

am 08.04.2011 16:02:09 von Rich Shepard

On Thu, 7 Apr 2011, Rich Shepard wrote:

> I'm migrating our Web site to CMS Made Simple, it worked here with
> postgres-8.4, but stopped working when I upgraded to postgres-9.0.0 (and I'm
> now running 9.0.3). This is with php-5.2.17 on Slackware-13.1. I need help
> since I don't know PHP or ADOdb.

Everyone:

I _think_ that I found the source of the problem, but I cannot seem to
get it fixed. When I looked more closely this morning at the configuration
section of the phpinfo() output I saw that the database was specified as
'postgreql-shared' and 'pdo-postgresql-shared'. I had done that a couple of
days ago when I re-built 5.2.17, then discoverdd that the actual name php
wants is 'pgsql.' So, I changed the options in the SlackBuild script to
reflect that:

--with-pgsql=shared,/usr \
--with-pdo-pgsql=shared,/usr \

and rebuilt the package. I then upgraded the installed package. However,
phpinfo() still showed

....ldap=shared' '--enable-mbstring=shared' '--enable-hash'
'--with-mhash=shared,/usr' '--with-postgresql=shared,/usr'
'--enable-pdo=shared' '--with-pdo-postgresql=shared,/usr' '--with-...

in the configure command section at the very top of the page.

Hmmm-m-m-m. So, just now I removed the package completely, rebuilt and
re-installed it. But, phpinfo() _still_ shows 'postgresql' rather than
'pgsql' and in the pdo section of the page only sqlite is shown. My
application still does not run.

The issue now is how to get rid of whatever phpinfo() is seeing so that it
can see (and use) the proper reference to the database. Why would phpinfo()
show the incorrect string if the configure options are correct?

Any ideas?

Rich



--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 17:34:50 von Rich Shepard

Where does phpinfo() get its information to display on the browser page? I
just noticed that the build date shown is 5 days old and does not reflect
the proper configuration of the build I did a couple of hours ago.

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 17:39:37 von Brian Fehrle

My experience with php and httpd is low, but I believe it does an audit
of the httpd server, seeing what is available in terms of services and
programs it can use. If what it shows is not correct, it could mean the
httpd server is not configured correctly, or possibly needs a restart.

- Brian F

On 04/08/2011 09:34 AM, Rich Shepard wrote:
> Where does phpinfo() get its information to display on the browser
> page? I
> just noticed that the build date shown is 5 days old and does not reflect
> the proper configuration of the build I did a couple of hours ago.
>
> Rich
>


--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 17:45:39 von DCarrero

Rich, I download CMS Made Simple 1.9.4.1 (the latest) and searching
for a adodb library I found that is using adodb lite [1] again not
explain how use with postgresql 9.

What if you install xdebug for more details?

I install CMS Made Simple and I have some errors with my version of
php (5.3.5 xampp windows 7)


[1] http://adodblite.sourceforge.net/howtoinstall.php

2011/4/8 Rich Shepard :
>  Where does phpinfo() get its information to display on the browser =
page? I
> just noticed that the build date shown is 5 days old and does not reflect
> the proper configuration of the build I did a couple of hours ago.
>
> Rich
>
> --
> Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-php
>



--=20
Daniel Carrero Canales
Analista programador de sistemas
+56974726453
http://www.kode.cl

--=20
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 17:48:38 von Rich Shepard

On Fri, 8 Apr 2011, Brian Fehrle wrote:

> ... it could mean the httpd server is not configured correctly, or
> possibly needs a restart.

Brian,

Restarting httpd did the trick. Still cannot start CMS, but the build date
is correct and so are the configuration options.

Thanks,

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 17:56:52 von Rich Shepard

On Fri, 8 Apr 2011, Daniel Carrero wrote:

> Rich, I download CMS Made Simple 1.9.4.1 (the latest) and searching for a
> adodb library I found that is using adodb lite [1] again not explain how
> use with postgresql 9.

Daniel,

Yes, I see it's using adodb-lite. That's what I have here.

> What if you install xdebug for more details?

Haven't used this before. I'll take a look.

Restarting httpd fixed the phpinfo() display. But trying to access cms
shows a page-not-found error in the access_log (but a success earlier this
morning although I did not see the CMS Made Simple page displayed). Many
errors in the error_log.

Thanks,

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 18:01:49 von DCarrero

Rich, maybe you can create a connection file to test and enable the
debug option for adodb.... [1]

http://adodblite.sourceforge.net/howtoinstall.php

2011/4/8 Rich Shepard :
> On Fri, 8 Apr 2011, Daniel Carrero wrote:
>
>> Rich, I download CMS Made Simple 1.9.4.1 (the latest) and searching for a
>> adodb library I found that is using adodb lite [1] again not explain how
>> use with postgresql 9.
>
> Daniel,
>
>  Yes, I see it's using adodb-lite. That's what I have here.
>
>> What if you install xdebug for more details?
>
>  Haven't used this before. I'll take a look.
>
>  Restarting httpd fixed the phpinfo() display. But trying to access =
cms
> shows a page-not-found error in the access_log (but a success earlier this
> morning although I did not see the CMS Made Simple page displayed). Many
> errors in the error_log.
>
> Thanks,
>
> Rich
>
> --
> Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-php
>



--=20
Daniel Carrero Canales
Analista programador de sistemas
+56974726453
http://www.kode.cl

--=20
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 18:32:57 von Rich Shepard

On Fri, 8 Apr 2011, Daniel Carrero wrote:

> Rich, maybe you can create a connection file to test and enable the debug
> option for adodb.... [1]
> http://adodblite.sourceforge.net/howtoinstall.php

Daniel,

adobd_lite is installed and configured by CMS Made Simple. I notice that
it does not explicitly support postgres9 yet, but changing the config.php to
postgres8 makes no difference.

I'll keep digging.

Thanks,

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 20:53:29 von Rich Shepard

On Fri, 8 Apr 2011, Rich Shepard wrote:

> adobd_lite is installed and configured by CMS Made Simple. I notice that
> it does not explicitly support postgres9 yet, but changing the config.php
> to postgres8 makes no difference.

Folks:

Now phpinfo() shows that postgres support is available in php and
recognized:

PDO
PDO support enabled
PDO drivers pgsql, sqlite, sqlite2

pdo_pgsql
PDO Driver for PostgreSQL enabled
PostgreSQL(libpq) Version 9.0.3
Module version 1.0.2
Revision $Id: pdo_pgsql.c 293036 2010-01-03 09:23:27Z sebastian $

pdo_sqlite
PDO Driver for SQLite 3.x enabled
PECL Module version 1.0.1 $Id: pdo_sqlite.c 293036 2010-01-03 09:23:27Z
sebastian $
SQLite Library 3.6.23.1

pgsql
PostgreSQL Support enabled
PostgreSQL(libpq) Version 9.0.3
Multibyte character support enabled
SSL support enabled
Active Persistent Links 0
Active Links 0

Directive Local Value Master Value
pgsql.allow_persistent On On
pgsql.auto_reset_persistent Off Off
pgsql.ignore_notice Off Off
pgsql.log_notice Off Off
pgsql.max_links Unlimited Unlimited
pgsql.max_persistent Unlimited Unlimited

This suggests to me that the problem is with adodb_lite. Since php is the
interface to that can the adodb.functions.php file be modified to try to
isolate the specific error?

I'll go look on sourceforge.net to see if the adodb_lite source is there.

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 08.04.2011 21:10:31 von Rich Shepard

I downloaded the adodb_lite source code (latest version from 2007). Is
there someone here fluent in PHP who will work with me to figure out what
needs to change in the postgres8 .php files to make them work with
postgres9?

There are all of 8 php files:

postgres8_datadict.inc postgres8_extend_module.inc
postgres8_date_module.inc postgres8_meta_module.inc
postgres8_driver.inc postgres8_transaction_module.inc

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Connecting PHP-based Application to Postgres-9.0.3

am 09.04.2011 00:07:17 von Rich Shepard

On Fri, 8 Apr 2011, Daniel Carrero wrote:

> I install CMS Made Simple and I have some errors with my version of
> php (5.3.5 xampp windows 7)

I've started to make adobd_lite work with postgresql-9.x. Modified 8 files
so far and now have explicit error messages to another 9 warnings and errors
to fix. When I get this all done I'll pass it on to the CMS Made Simple
devs.

Turns out I can diff the version7 and version8 files and apply those
differences to the version9 files.

Rich

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php