Thread: Connecting PHP-based Application to Postgres-9.0.3
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
Attachment
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.
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
On April 7, 2011, Rich Shepard <rshepard@appl-ecosys.com> wrote:
> 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:
>
What does your pg_hba.conf file contain?
--
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…
In response to Rich Shepard <rshepard@appl-ecosys.com>: > 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/
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
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
In response to Rich Shepard <rshepard@appl-ecosys.com>: > 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/
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
On April 7, 2011, Rich Shepard <rshepard@appl-ecosys.com> wrote:
> 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
What is @authmethod@? That looks like a substitution parameter from something?
The default that should be in there is I think ident, which probably allows you to access it as rshepard but not the web server to do so, which is running under a different user.
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.
--
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…
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
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 >
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
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 <port> -U <user> <database name> 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=251336 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 >
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 >
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
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 >
On Thu, 7 Apr 2011, Brian Fehrle wrote: > Also, this may help: > http://forum.cmsmadesimple.org/viewtopic.php?t=53350&p=251336 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
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
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
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
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 <rod@iol.ie>: > 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
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
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
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
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.php /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
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
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
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
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 <rshepard@appl-ecosys.com> 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
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
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
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 >
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 <rshepard@appl-ecosys.com>: > 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 > -- Daniel Carrero Canales Analista programador de sistemas +56974726453 http://www.kode.cl
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
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
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 <rshepard@appl-ecosys.com>: > 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 > -- Daniel Carrero Canales Analista programador de sistemas +56974726453 http://www.kode.cl
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
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
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
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
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