Re: PostgreSQL + PHP 4.2x buggy with Apache?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: PostgreSQL + PHP 4.2x buggy with Apache?
Дата
Msg-id 200208062015.49340.dev@archonet.com
обсуждение исходный текст
Ответ на PostgreSQL + PHP 4.2x buggy with Apache?  (jfo123@hotmail.com (Axier))
Список pgsql-general
On Tuesday 06 Aug 2002 3:53 pm, Axier wrote:
> Hi,
>
> anyone that could help me out would do me a great favour.
>
> I ran in to this problem yesterday.
> Issue: I am trying to import a huge table into pgsql using "Copy
> from".
> I do it like this: Simple html-interface, opening txt-files
> and then I use copy to perform a high-speed insert.
>
> The environment used from the beginning was Apache 2.0.39 + PHP 4.2.2
> + PostgreSQL 7.2 under Cygwin.

I'm not sure Cygwin is recommended for a production system - I run on Linux so
I can't say definitely though.

> After a while I noticed that the webserver stopped responding so I
> downgraded to 1.3.26 and now everything started to jump fairly well,
> until yesterday night.

> After last night I cannot connect via the webinterface anylonger. The
> webserver still answers on requests and I can logon via psql or
> pgAdmin and issue commands there, but no way to connect via my
> PHP-script.
>
> the line that hangs is the pg_connect:
> $link = pg_pconnect("dbname=$Database user=$DbId password=$DbPassword
> host=localhost");

Does the pg_pconnect() just hang, or do you get an error code? If you get an
error, then that's something it would be useful to see.

I'm guessing you've got a bunch of connections still open to the database and
that's causing your problems. Use ps to see what's running (if Cygwin handles
that). See if pg_connect() helps perhaps.

I wasn't aware that PHP + Apache 2 was stable yet - stick with 1.3 for the
moment if I was you. Also, I don't think the Postgresql libraries are
thread-safe (not sure though) and I'm not sure if Windows versions of
Apache/PHP use threads by default.

Since you can connect via psql/pgadmin it doesn't look like a problem at the
Postgresql end.

- Richard Huxton

В списке pgsql-general по дате отправления:

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: MySQL or Postgres ?
Следующее
От: Ralph Graulich
Дата:
Сообщение: Re: PostgreSQL + PHP 4.2x buggy with Apache?