X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4D2E953506 for ; Thu, 31 Mar 2005 16:38:56 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 71593-01 for ; Thu, 31 Mar 2005 15:38:53 +0000 (GMT) Received: from grassmarket.ucs.ed.ac.uk (grassmarket.ucs.ed.ac.uk [129.215.166.64]) by svr1.postgresql.org (Postfix) with ESMTP id A4663534F9 for ; Thu, 31 Mar 2005 16:38:51 +0100 (BST) Received: from grassmarket.ucs.ed.ac.uk (localhost [127.0.0.1]) by grassmarket.ucs.ed.ac.uk (8.12.10/8.12.10) with ESMTP id j2VFctY8010272 for ; Thu, 31 Mar 2005 16:38:55 +0100 (BST) Received: (from nobody@localhost) by grassmarket.ucs.ed.ac.uk (8.12.10/8.12.9/Submit) id j2VFctVa010268 for pgsql-php@postgresql.org; Thu, 31 Mar 2005 16:38:55 +0100 (BST) From: SG Edwards X-Authentication-Warning: grassmarket.ucs.ed.ac.uk: nobody set sender to s0460205@sms.ed.ac.uk using -f Received: from sem30.icmb.ed.ac.uk (sem30.icmb.ed.ac.uk [129.215.237.51]) by sms.ed.ac.uk (IMP) with HTTP for ; Thu, 31 Mar 2005 16:38:55 +0100 Message-ID: <1112283535.424c198f6f8ec@sms.ed.ac.uk> Date: Thu, 31 Mar 2005 16:38:55 +0100 To: pgsql-php@postgresql.org Subject: failed connection to postgres MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.3 X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.516 tagged_above=0 required=5 tests=FROM_ENDS_IN_NUMS X-Spam-Level: X-Archive-Number: 200503/67 X-Sequence-Number: 3082 If I use the following code to connect to postgres using PHP: However, the connection is not made. If I try to run it from the command line in UNIX I get the following error: PHP warning: pg_connect(): Unable to connect to PostgreSQL server: invalid connection option "dbuser" in /home/s0460205/public_html/first.php on line 12 The username, database name and password are definately right and my database is on the same server as the script (thus I assume localhost for host?) so should this not work? Many thanks for your help