[pgsql-jp: 36863] PHPで接続できません

mail mail @ mail.rishiri.info
2006年 3月 11日 (土) 18:14:17 JST


こんにちは、どうしても解決できません。

Apache/2.0.55 (FreeBSD) PHP/4.4.1 mod_ssl/2.0.55 OpenSSL/0.9.7i
portsからmake installしたPostgreSQL8.1.3という環境です。
PHPのブログを表示させようとしているのですが
接続できないというようなエラーにより表示されなかったので
をクライアントのIEから
以下の.phpを

# /usr/local/www/hoge/sites/default/test.php
<?php
  if($conn = pg_connect("host=localhost port=5432 dbname=template1"))
 {
    echo '接続しました';
    pg_close($conn);
  } else {
    echo '接続できません';
  }
?>

http://サーバーのアドレス/hoge/sites/default/test.php で
表示させると

Warning: pg_connect(): Cannot create new link. Too many open links (0) in
/usr/local/www/hoge/sites/default/test.php on line 2
という結果が返されます。

クライアントのターミナルからは
$ psql template1
Welcome to psql 8.1.3, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit
というふうに接続できています。

# /usr/local/pgsql/data/postgresql.conf は、
listen_addresses='localhost' を
listen_addresses='*' に変更

# /usr/local/pgsql/data/pg_hba.conf は、
# "local" is for Unix domain socket connections only
local   all         all                               trust
# IPv4 local connections:
host    all         all         127.0.0.1/32          trust
host    all         all         192.168.1.1/32          trust

# /usr/local/etc/php/extension.ini は、
extension=pgsql.so

# phpinfo() は
pgsql
----------------------------------+------------
PostgreSQL Support                                 enabled
PostgreSQL(libpq) Version                         8.1.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

という内容です。
どなたかどうすればよいか教えてください。
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.0.375 / Virus Database: 268.2.1/279 - Release Date: 2006/03/10




pgsql-jp メーリングリストの案内