Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eBD20gM31475 for ; Tue, 12 Dec 2000 21:00:42 -0500 (EST) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242] (may be forged)) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBD06kM19243 for ; Tue, 12 Dec 2000 19:06:46 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.9.3/8.9.3) id SAA35330 for pgsql-sql@postgresql.org; Tue, 12 Dec 2000 18:49:33 -0500 (EST) (envelope-from news) X-Authentication-Warning: news.tht.net: news set sender to using -f From: Luca Pregliasco X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Persistent Connects (pg_pconnect) Date: Wed, 13 Dec 2000 00:50:40 +0100 Organization: IF Internet Farm s.p.a. Lines: 36 Message-ID: <3A36B9D0.AC0BFEBD@apuanet.bicnet.it> References: <4.3.2.7.2.20001128111923.00b3c008@192.168.1.253> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.tht.net 976664970 35325 151.99.231.102 (12 Dec 2000 23:49:30 GMT) X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.16-SMP i686) X-Accept-Language: it, en To: pgsql-sql@postgresql.org X-Archive-Number: 200012/96 X-Sequence-Number: 429 Colleen Williams wrote: > However we had another problem, the solution with using pg_connect instead > of pg_pconnect worked on DEV but not on PROD. We think it is to do with > different PHP versions. DEV was using PHP4.0.1p2 and PROD was using > PHP4.0.3p1. We think maybe there is a variable scoping problem PHP4.0.3p1. > Perhaps PHP doesn't really work so well with object code and so we > shouldn't be using object code. > > I have used the following code to do the database connect in my db.inc. To > make the code work in PROD I have had to make $connection a global variable > (by uncommenting the commented lines) as although it would connect fine and > return a valid connection index, the next time I went to fetch the query, > postgres would return an 'invalid postgres resource link' error. However in > DEV (PHP4.0.1p2) it was working fine - creating a new postgres resource > when a new query object is created. > > If you can see a bug in my code and it is not at all a PHP version problem > OR if you can confirm it is a PHP version problem please let me know. I > would like to know if I am just doing it all wrong. We are having exactly the same problem, with exactly the same configurations, and we also reached the conclusion about PHP not working fine with variable scoping in objects. The code you supplied in example is very similar to our source, this also confirms our fears. We are investigating every single difference between the two PHP versions to figure out a serius fix. bye Luca Pregliasco upa@apuanet.bicnet.it IF Internet Farm S.p.A. Via Dorsale 13 - 54100 Massa - Italia