Re: [PHP-DB] Re: PostgreSQL error with PHP
Thanks for the help. It works. I'm also posting my two .conf file that I had to configure. postgresql.conf: [EMAIL PROTECTED] data]# cat postgresql.conf # - # PostgreSQL configuration file # - # # This file consists of lines of the form: # # name = value # # (The '=' is optional.) White space may be used. Comments are introduced # with '#' anywhere on a line. The complete list of option names and # allowed values can be found in the PostgreSQL documentation. The # commented-out settings shown in this file represent the default values. # # Any option can also be given as a command line switch to the # postmaster, e.g. 'postmaster -c log_connections=on'. Some options # can be changed at run-time with the 'SET' SQL command. # # This file is read on postmaster startup and when the postmaster # receives a SIGHUP. If you edit the file on a running system, you have # to SIGHUP the postmaster for the changes to take effect, or use # "pg_ctl reload". #--- # CONNECTIONS AND AUTHENTICATION #--- # - Connection Settings - # Thomas Bonham 06-25-2005 #tcpip_socket = false tcpip_socket = yes max_connections = 100 # note: increasing max_connections costs about 500 bytes of shared # memory per connection slot, in addition to costs from shared_buffers # and max_locks_per_transaction. superuser_reserved_connections = 2 port = 5432 #unix_socket_directory = '' #unix_socket_group = '' #unix_socket_permissions = 0777 # octal #virtual_host = '' # what interface to listen on; defaults to any #rendezvous_name = '' # defaults to the computer name # - Security & Authentication - #authentication_timeout = 60# 1-600, in seconds #ssl = false password_encryption = true #krb_server_keyfile = '' #db_user_namespace = false #--- # RESOURCE USAGE (except WAL) #--- # - Memory - shared_buffers = 1000 # min 16, at least max_connections*2, 8KB each #sort_mem = 1024# min 64, size in KB #vacuum_mem = 8192 # min 1024, size in KB # - Free Space Map - #max_fsm_pages = 2 # min max_fsm_relations*16, 6 bytes each #max_fsm_relations = 1000 # min 100, ~50 bytes each # - Kernel Resource Usage - #max_files_per_process = 1000 # min 25 #preload_libraries = '' #--- # WRITE AHEAD LOG #--- # - Settings - #fsync = true # turns forced synchronization on or off #wal_sync_method = fsync# the default varies across platforms: # fsync, fdatasync, open_sync, or open_datasync #wal_buffers = 8# min 4, 8KB each # - Checkpoints - #checkpoint_segments = 3# in logfile segments, min 1, 16MB each #checkpoint_timeout = 300 # range 30-3600, in seconds #checkpoint_warning = 30# 0 is off, in seconds #commit_delay = 0 # range 0-10, in microseconds #commit_siblings = 5# range 1-1000 #--- # QUERY TUNING #--- # - Planner Method Enabling - #enable_hashagg = true #enable_hashjoin = true #enable_indexscan = true #enable_mergejoin = true #enable_nestloop = true #enable_seqscan = true #enable_sort = true #enable_tidscan = true # - Planner Cost Constants - #effective_cache_size = 1000# typically 8KB each #random_page_cost = 4 # units are one sequential page fetch cost #cpu_tuple_cost = 0.01 # (same) #cpu_index_tuple_cost = 0.001 # (same) #cpu_operator_cost = 0.0025 # (same) # - Genetic Query Optimizer - #geqo = true #geqo_threshold = 11 #geqo_effort = 1 #geqo_generations = 0 #geqo_pool_size = 0 # default based on tables in statement, # range 128-1024 #geqo_selection_bias = 2.0 # range 1.5-2.0 # - Other Planner Options - #default_statistics_target = 10 # range 1-1000 #from_collapse_limit = 8 #join_collapse_limit = 8# 1 disables collapsing of explicit JOINs #--- # ERROR REPORTING AND LOGGING #--- # - Syslog - #syslog = 0 # range 0-2; 0=stdout; 1=both; 2=syslog #syslog_facility = 'LOCAL0' #syslog_ident = 'postgres' # - When to Log - #client_min_messages = notice # Values, in order of decreasing detail: # debug5, debug4, debug
Re: [PHP-DB] Re: PostgreSQL error with PHP
El Dom 26 Jun 2005 22:48, Thomas Bonham escribió: > Thanks for the help. > The code now looks like this. > CODE: > > Login > > > > > $conn = pg_connect("user=auth dbname=auth password=redhat") > or die ("Could not connect") ; > echo "Connectd Successfully"; > pg_close($conn); > > ?> > > > > And now the error I get is the following. > > > Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: > IDENT authentication failed for user "auth" in > /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 > Could not connect Check your pg_hba.conf file. Looks like you have IDENT authentification, and auth is not a system user. Read the PostgreSQL documentation about this. -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: PostgreSQL error with PHP
I think so. I'm going to go there my book (agin) and I'm also going to ask the head IT guy. Thanks for all of your help! Thomas Robbert van Andel wrote: Can you log into the PostgreSQL server from the console or command line? Are you sure you are using the right username, password or host? -Original Message- From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, June 26, 2005 8:03 PM To: php-db@lists.php.net Subject: Re: [PHP-DB] Re: PostgreSQL error with PHP I rewrote the code. This is the code and errors. This is starting to get old, I have been working on this for over a week now. CODE: Login Error: Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host "localhost" and accepting TCP/IP connections on port 5432? in /var/www/html/thomas/cis166ae/database/secretdb.php on line 11 Connected Successfully Thomas Thomas Bonham wrote: I add the hostname and port, then I configure postgresql.conf and enable the port 5432 line in the config file. So this is the new code. Login $conn = pg_connect(" user=auth dbname=auth password=redhat host=thomas.example.com port=5432" ) or die ("Could not connect") ; echo "Connected Successfully"; pg_close($conn); ?> With the new error. Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host "thomas.example.com" and accepting TCP/IP connections on port 5432? in /var/www/html/thomas/cis166ae/database/secretdb.php on line 10 Could not connect Thomas Robbert van Andel wrote: You might need to include the hostname and port. -Original Message- From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, June 26, 2005 6:48 PM To: php-db@lists.php.net Subject: Re: [PHP-DB] Re: PostgreSQL error with PHP Thanks for the help. The code now looks like this. CODE: Login $conn = pg_connect("user=auth dbname=auth password=redhat") or die ("Could not connect") ; echo "Connectd Successfully"; pg_close($conn); ?> And now the error I get is the following. Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: IDENT authentication failed for user "auth" in /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 Could not connect Thomas Robbert van Andel wrote: The error is in your function pg_connect pg_connect("name=auth user=auth"); I'm not a PostgreSQL user but your connection string should be enclosed into by quotes. Documentation can be found at http://us3.php.net/manual/en/function.pg-connect.php Hope this helps, Robbert -Original Message- From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, June 26, 2005 5:43 PM To: php-db@lists.php.net Subject: [PHP-DB] Re: PostgreSQL error with PHP I modafide the code some more and now with the following code I get this error. CODE: Login pg_connect(name="auth"); (user="auth"); ?> Parse error: parse error, unexpected '=' in /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 Thanks Thomas Bonham wrote: Hello All, I'm trying to get php to connect to my PostgreSQL database. The code that I'm using is below. Login Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: IDENT authentication failed for user "auth" in /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 Below is how I set up my database. [EMAIL PROTECTED] # Su - postgres -bash-3.00$ createuser -D -A -E auth -bash-3.00$ createdb auth Thanks Helping -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: PostgreSQL error with PHP
Can you log into the PostgreSQL server from the console or command line? Are you sure you are using the right username, password or host? -Original Message- From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, June 26, 2005 8:03 PM To: php-db@lists.php.net Subject: Re: [PHP-DB] Re: PostgreSQL error with PHP I rewrote the code. This is the code and errors. This is starting to get old, I have been working on this for over a week now. CODE: Login Error: Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host "localhost" and accepting TCP/IP connections on port 5432? in /var/www/html/thomas/cis166ae/database/secretdb.php on line 11 Connected Successfully Thomas Thomas Bonham wrote: > I add the hostname and port, then I configure postgresql.conf and enable > the port 5432 line in the config file. > > So this is the new code. > > >Login > > > > > $conn = pg_connect(" > user=auth dbname=auth password=redhat host=thomas.example.com > port=5432" ) or die ("Could not connect") ; > echo "Connected Successfully"; > pg_close($conn); > >?> > > > > With the new error. > > Warning: pg_connect(): Unable to connect to PostgreSQL server: could not > connect to server: Connection refused Is the server running on host > "thomas.example.com" and accepting TCP/IP connections on port 5432? in > /var/www/html/thomas/cis166ae/database/secretdb.php on line 10 > Could not connect > > Thomas > > > > Robbert van Andel wrote: > >> You might need to include the hostname and port. >> >> -Original Message- >> From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, >> June 26, 2005 6:48 PM >> To: php-db@lists.php.net >> Subject: Re: [PHP-DB] Re: PostgreSQL error with PHP >> >> Thanks for the help. >> The code now looks like this. >> CODE: >> >> Login >> >> >> >> > >> $conn = pg_connect("user=auth dbname=auth password=redhat") >> or die ("Could not connect") ; >> echo "Connectd Successfully"; >> pg_close($conn); >> >> ?> >> >> >> >> And now the error I get is the following. >> >> >> Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: >> IDENT authentication failed for user "auth" in >> /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 >> Could not connect >> >> >> Thomas >> >> Robbert van Andel wrote: >> >>> The error is in your function pg_connect >>> pg_connect("name=auth user=auth"); >>> >>> I'm not a PostgreSQL user but your connection string should be enclosed >> >> >> into >> >>> by quotes. Documentation can be found at >>> http://us3.php.net/manual/en/function.pg-connect.php >>> >>> Hope this helps, >>> Robbert >>> >>> -Original Message- >>> From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, >>> June 26, 2005 5:43 PM >>> To: php-db@lists.php.net >>> Subject: [PHP-DB] Re: PostgreSQL error with PHP >>> >>> I modafide the code some more and now with the following code I get >>> this error. >>> CODE: >>> Login >>> >>> >>> >>>>> >>> pg_connect(name="auth"); (user="auth"); >>>?> >>> >>> >>> >>> >>> Parse error: parse error, unexpected '=' in >>> /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 >>> >>> Thanks >>> >>> Thomas Bonham wrote: >>> >>> >>>> Hello All, >>>> I'm trying to get php to connect to my PostgreSQL database. >>>> The code that I'm using is below. >>>> >>>> >>>> Login >>>> >>>> >>>> >>>> >>> $conn = "dbname=auth user=auth"; >>>> $db = pg_connect ( $conn ); >>>> ?> >>>> >>>> >>>> >>>> Warning: pg_connect(): Unable to connect to PostgreSQL server: >>>> FATAL: IDENT authentication failed for user "auth" in >>>> /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 >>>> >>>> Below is how I set up my database. >>>> >>>> [EMAIL PROTECTED] # Su - postgres >>>> >>>> -bash-3.00$ createuser -D -A -E >>>> auth >>>> -bash-3.00$ createdb auth >>>> >>>> Thanks Helping >>> >>> >>> >> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: PostgreSQL error with PHP
I rewrote the code. This is the code and errors. This is starting to get old, I have been working on this for over a week now. CODE: Login Error: Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host "localhost" and accepting TCP/IP connections on port 5432? in /var/www/html/thomas/cis166ae/database/secretdb.php on line 11 Connected Successfully Thomas Thomas Bonham wrote: I add the hostname and port, then I configure postgresql.conf and enable the port 5432 line in the config file. So this is the new code. Login $conn = pg_connect(" user=auth dbname=auth password=redhat host=thomas.example.com port=5432" ) or die ("Could not connect") ; echo "Connected Successfully"; pg_close($conn); ?> With the new error. Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host "thomas.example.com" and accepting TCP/IP connections on port 5432? in /var/www/html/thomas/cis166ae/database/secretdb.php on line 10 Could not connect Thomas Robbert van Andel wrote: You might need to include the hostname and port. -Original Message- From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, June 26, 2005 6:48 PM To: php-db@lists.php.net Subject: Re: [PHP-DB] Re: PostgreSQL error with PHP Thanks for the help. The code now looks like this. CODE: Login $conn = pg_connect("user=auth dbname=auth password=redhat") or die ("Could not connect") ; echo "Connectd Successfully"; pg_close($conn); ?> And now the error I get is the following. Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: IDENT authentication failed for user "auth" in /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 Could not connect Thomas Robbert van Andel wrote: The error is in your function pg_connect pg_connect("name=auth user=auth"); I'm not a PostgreSQL user but your connection string should be enclosed into by quotes. Documentation can be found at http://us3.php.net/manual/en/function.pg-connect.php Hope this helps, Robbert -Original Message- From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, June 26, 2005 5:43 PM To: php-db@lists.php.net Subject: [PHP-DB] Re: PostgreSQL error with PHP I modafide the code some more and now with the following code I get this error. CODE: Login pg_connect(name="auth"); (user="auth"); ?> Parse error: parse error, unexpected '=' in /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 Thanks Thomas Bonham wrote: Hello All, I'm trying to get php to connect to my PostgreSQL database. The code that I'm using is below. Login Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: IDENT authentication failed for user "auth" in /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 Below is how I set up my database. [EMAIL PROTECTED] # Su - postgres -bash-3.00$ createuser -D -A -E auth -bash-3.00$ createdb auth Thanks Helping -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: PostgreSQL error with PHP
I add the hostname and port, then I configure postgresql.conf and enable the port 5432 line in the config file. So this is the new code. Login With the new error. Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host "thomas.example.com" and accepting TCP/IP connections on port 5432? in /var/www/html/thomas/cis166ae/database/secretdb.php on line 10 Could not connect Thomas Robbert van Andel wrote: You might need to include the hostname and port. -Original Message- From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, June 26, 2005 6:48 PM To: php-db@lists.php.net Subject: Re: [PHP-DB] Re: PostgreSQL error with PHP Thanks for the help. The code now looks like this. CODE: Login And now the error I get is the following. Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: IDENT authentication failed for user "auth" in /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 Could not connect Thomas Robbert van Andel wrote: The error is in your function pg_connect pg_connect("name=auth user=auth"); I'm not a PostgreSQL user but your connection string should be enclosed into by quotes. Documentation can be found at http://us3.php.net/manual/en/function.pg-connect.php Hope this helps, Robbert -Original Message- From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, June 26, 2005 5:43 PM To: php-db@lists.php.net Subject: [PHP-DB] Re: PostgreSQL error with PHP I modafide the code some more and now with the following code I get this error. CODE: Login Parse error: parse error, unexpected '=' in /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 Thanks Thomas Bonham wrote: Hello All, I'm trying to get php to connect to my PostgreSQL database. The code that I'm using is below. Login Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: IDENT authentication failed for user "auth" in /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 Below is how I set up my database. [EMAIL PROTECTED] # Su - postgres -bash-3.00$ createuser -D -A -E auth -bash-3.00$ createdb auth Thanks Helping -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: PostgreSQL error with PHP
You might need to include the hostname and port. -Original Message- From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, June 26, 2005 6:48 PM To: php-db@lists.php.net Subject: Re: [PHP-DB] Re: PostgreSQL error with PHP Thanks for the help. The code now looks like this. CODE: Login And now the error I get is the following. Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: IDENT authentication failed for user "auth" in /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 Could not connect Thomas Robbert van Andel wrote: > The error is in your function pg_connect > pg_connect("name=auth user=auth"); > > I'm not a PostgreSQL user but your connection string should be enclosed into > by quotes. Documentation can be found at > http://us3.php.net/manual/en/function.pg-connect.php > > Hope this helps, > Robbert > > -Original Message- > From: Thomas Bonham [mailto:[EMAIL PROTECTED] > Sent: Sunday, June 26, 2005 5:43 PM > To: php-db@lists.php.net > Subject: [PHP-DB] Re: PostgreSQL error with PHP > > I modafide the code some more and now with the following code I get this > error. > CODE: > Login > > > > > pg_connect(name="auth"); (user="auth"); > ?> > > > > > Parse error: parse error, unexpected '=' in > /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 > > Thanks > > Thomas Bonham wrote: > >>Hello All, >>I'm trying to get php to connect to my PostgreSQL database. >>The code that I'm using is below. >> >> >> Login >> >> >> >> > $conn = "dbname=auth user=auth"; >>$db = pg_connect ( $conn ); >> ?> >> >> >> >>Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: >>IDENT authentication failed for user "auth" in >>/var/www/html/thomas/cis166ae/database/secretdb.php on line 8 >> >>Below is how I set up my database. >> >>[EMAIL PROTECTED] # Su - postgres >> >>-bash-3.00$ createuser -D -A -E >>auth >>-bash-3.00$ createdb auth >> >>Thanks Helping > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: PostgreSQL error with PHP
Thanks for the help. The code now looks like this. CODE: Login And now the error I get is the following. Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: IDENT authentication failed for user "auth" in /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 Could not connect Thomas Robbert van Andel wrote: The error is in your function pg_connect pg_connect("name=auth user=auth"); I'm not a PostgreSQL user but your connection string should be enclosed into by quotes. Documentation can be found at http://us3.php.net/manual/en/function.pg-connect.php Hope this helps, Robbert -Original Message- From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, June 26, 2005 5:43 PM To: php-db@lists.php.net Subject: [PHP-DB] Re: PostgreSQL error with PHP I modafide the code some more and now with the following code I get this error. CODE: Login Parse error: parse error, unexpected '=' in /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 Thanks Thomas Bonham wrote: Hello All, I'm trying to get php to connect to my PostgreSQL database. The code that I'm using is below. Login Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: IDENT authentication failed for user "auth" in /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 Below is how I set up my database. [EMAIL PROTECTED] # Su - postgres -bash-3.00$ createuser -D -A -E auth -bash-3.00$ createdb auth Thanks Helping -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: PostgreSQL error with PHP
The error is in your function pg_connect pg_connect("name=auth user=auth"); I'm not a PostgreSQL user but your connection string should be enclosed into by quotes. Documentation can be found at http://us3.php.net/manual/en/function.pg-connect.php Hope this helps, Robbert -Original Message- From: Thomas Bonham [mailto:[EMAIL PROTECTED] Sent: Sunday, June 26, 2005 5:43 PM To: php-db@lists.php.net Subject: [PHP-DB] Re: PostgreSQL error with PHP I modafide the code some more and now with the following code I get this error. CODE: Login Parse error: parse error, unexpected '=' in /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 Thanks Thomas Bonham wrote: > Hello All, > I'm trying to get php to connect to my PostgreSQL database. > The code that I'm using is below. > > >Login > > > >$conn = "dbname=auth user=auth"; > $db = pg_connect ( $conn ); >?> > > > > Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: > IDENT authentication failed for user "auth" in > /var/www/html/thomas/cis166ae/database/secretdb.php on line 8 > > Below is how I set up my database. > > [EMAIL PROTECTED] # Su - postgres > > -bash-3.00$ createuser -D -A -E > auth > -bash-3.00$ createdb auth > > Thanks Helping -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php