Search Postgresql Archives

Re: problems connecting to php via pg_connect and PGCLUSTER

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/02/12 17:08, Dave Potts wrote:
Hi Chris
Thanks for the suggestion,  I tried a making the changes are you suggest,
I still getting an error from Postgres ie
  define("PG_OPTIONS"  , "--cluster=9.1/main");
  define("PG_DB"  , "tripe");
  define("PG_HOST", "localhost");
  define("PG_USER", "dp42");
  define("PG_PORT", "5432");
  define("TABLE",   "route_table");
$con = pg_connect("dbname='".PG_DB."' host='".PG_HOST."'
user='".PG_USER."' options='".PG_OPTIONS."'");

Error message
04:41 2012] [error] [client 127.0.0.1] PHP Warning:  pg_connect(): Unable
to connect to PostgreSQL server: FATAL:  unrecognised configuration
parameter "cluster" in /var/www/re/php/pgrouting.php on line 34, referer:
http://127.0.0.1/re/routing-final.html

The problem is with the database server it has issues with the string
--cluster=9.1/main"

The system is happy enough if I set PGCLUSTER as follows

export PGCLUSTER=9.1/main
psql -d tripe

psql knows what 'PGCLUSTER' is.

pg_connect() doesn't (unrecognised parameter "cluster"), so you can't do it that way.

You could try

define('PG_OPTIONS', 'PGCLUSTER=9.1/main');

If that doesn't work you'll have to do it the other way I mentioned.

--
Postgresql & php tutorials
http://www.designmagick.com/


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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux