1

Topic: Connection to host localhost is broken.

I have installed PunBB 1.2.16 on Fedora 8, using PostgreSQL 8.2.5, and Apache 2.2.6. I have got as far as creating the config.php file in the PunBB installation directory.

When I follow the link to the forum, I get the following error message:

An error occurred while loading http://localhost/punbb-forum/index.php:
Connection to host localhost is broken.

I can connect to PostgreSQL on the command line with:

$ psql -d dbname -U username

and enter the password at the prompt.

I have disabled passwords in pg_hba.conf. Still cannot connect though.

This is the output from phpinfo for Postgres:

pgsql
PostgreSQL Support enabled
PostgreSQL(libpq) Version   8.2.5 
  Multibyte character support   enabled 
  SSL support   disabled 
  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

Any ideas what is happening please?

I don't get this error when accessing the installation script, install.php. Directory listings are working for the PunBB installation dir as well.

2 (edited by CD-RW 2007-12-10 20:33)

Re: Connection to host localhost is broken.

Checking my Apache logs shows me this:

[Mon Dec 10 20:13:24 2007] [info] mod_unique_id: using ip addr 10.0.0.1
[Mon Dec 10 20:13:25 2007] [notice] Digest: generating secret for digest authentication ...
[Mon Dec 10 20:13:25 2007] [notice] Digest: done
[Mon Dec 10 20:13:25 2007] [info] mod_unique_id: using ip addr 10.0.0.1
[Mon Dec 10 20:13:26 2007] [notice] Apache/2.2.6 (Unix) PHP/5.2.5 configured -- resuming normal operations
[Mon Dec 10 20:13:26 2007] [info] Server built: Nov  1 2007 14:29:28
[Mon Dec 10 20:13:26 2007] [debug] prefork.c(991): AcceptMutex: sysvsem (default: sysvsem)
[Mon Dec 10 20:13:51 2007] [notice] child pid 29312 exit signal Segmentation fault (11)
[Mon Dec 10 20:13:51 2007] [notice] child pid 29313 exit signal Segmentation fault (11)
[Mon Dec 10 20:14:01 2007] [notice] child pid 29314 exit signal Segmentation fault (11)
[Mon Dec 10 20:14:01 2007] [notice] child pid 29321 exit signal Segmentation fault (11)
[Mon Dec 10 20:20:07 2007] [info] [client ::1] (32)Broken pipe: core_output_filter: writing data to the network

So it appears the problem may be something to do with Apache.

It may be a bug in PHP, according to these posts:

http://bugs.php.net/bug.php?id=30410

http://lists.freebsd.org/pipermail/free … 23113.html

Re: Connection to host localhost is broken.

Or with PHP itself. Maybe the PGSQL module has been badly built?

4

Re: Connection to host localhost is broken.

Recompiling again on the host machine. The compile was done on my laptop, and zipped up and ftp'd to the main machine. Will post the results ASAP.

5

Re: Connection to host localhost is broken.

I recompiled PHP 5.2.5 against Apache 2.2.6 and MySQL 5.0.45 and Postgresql 8.2.5. Still the same problem. This is what my postgres logfile tells me:

LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection

This was using the PHP 5.2.5 apache server module.

What I did was this:

copied a previous 5.2.1 version of the apache php module, from my apache-2.2.0 modules to the apache-2.2.6 modules dir.

So apache 2.2.6 is now running a php-5.2.1 module compiled against apache -2.2.0.

This enables PunnBB to work correctly now.

I guess the safest thing would be to downgrade to Apache 2.2.0 and use the php 5.2.1 module compiled for that?

Anyway it works now. Thanks for the replies. So do you think the problem is with the php 5.2.5 apache module?

6

Re: Connection to host localhost is broken.

Just checked phpinfo output for php 5.2.1, and this was compiled against postgresql 8.2.1.

pgsql

PostgreSQL Support    enabled
PostgreSQL(libpq) Version   8.2.1
  Multibyte character support   enabled
  SSL support   disabled
  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

So the problem may be with postgresql 8.2.5

7

Re: Connection to host localhost is broken.

Well I have compiled php 5.2.4 with the following configuration:

#! /bin/sh
#
# Created by configure

'./configure' \
'--with-apxs2=/usr/local/apache-2.2.6/bin/apxs' \
'--prefix=/usr/local/php-5.2.4' \
'--bindir=/usr/local/bin' \
'--enable-shared=all' \
'--without-pear' \
'--with-mysql=shared,/usr/local/mysql-5.0.45' \
'--with-mysql-sock=/var/lib/databases/mysql/mysql.sock' \
'--with-mysqli=shared,/usr/local/mysql-5.0.45/bin/mysql_config' \
'--with-pgsql=/usr/local/postgresql-8.2.5/bin' \
'--with-xsl' \
'--with-zlib-dir=/usr/include' \
'--with-readline' \
"$@"

All seems to be working OK now. The only change in this configuration is downgrading to php 5.2.4

So maybe it's a bug in php 5.2.5 causing the connection broken message?

8

Re: Connection to host localhost is broken.

Why the '$@' ? Are you passing any more config switches? By the sounds of your description, I'd personally say you have a schizo system. Work from a system where all modules/progs are actually the ones that have been compiled against the relevant versions, and compile it against those, not by mixing and matching.

Re: Connection to host localhost is broken.

Err, Matt, what's wrong with that ./configure?

10

Re: Connection to host localhost is broken.

Smartys wrote:

Err, Matt, what's wrong with that ./configure?

With the configure script, nothing that I can see offhand. smile

Re: Connection to host localhost is broken.

...then what were you talking about? tongue

12

Re: Connection to host localhost is broken.

It's the way he's describing things. big_smile I just personally think it sounds most likely that he's having a version mismatch somewhere with what he's compiling against.

Re: Connection to host localhost is broken.

Oh. Yes, it's very possible: I thought you were referring to how certain programs were configured tongue

14

Re: Connection to host localhost is broken.

MattF wrote:

Why the '$@' ? Are you passing any more config switches? By the sounds of your description, I'd personally say you have a schizo system. Work from a system where all modules/progs are actually the ones that have been compiled against the relevant versions, and compile it against those, not by mixing and matching.

That's a valid comment concerning using a php module compiled for apache 2.2.0 with the apache 2.2.6 version. I just tried that for testing purposes, to see if it would work. It helped me to narrow down and identify where the problem was.

I thought it was postgresql, but it can't be, because the above working ./configure is compiled against 8.2.5 . So IMHO it has to be a problem with php.

Regarding the $@ on the last configure line. That's exactly how it was generated in the config.nice file. Notice the arguments to configure are in single quotes. I think the $@ line is required to tell configure there are no more options to parse. Without the options in single quotes, then as you say, the $@ line is not needed.

I have done a fresh installation of the postgresql database, and will do a new installation of PunBB on top of that. So everything should be in a clean pristine condition. wink

15

Re: Connection to host localhost is broken.

CD-RW wrote:

Regarding the $@ on the last configure line. That's exactly how it was generated in the config.nice file. Notice the arguments to configure are in single quotes. I think the $@ line is required to tell configure there are no more options to parse. Without the options in single quotes, then as you say, the $@ line is not needed.

The $@ includes any arguments/switches passed via the standard input, as well as those included in the script.