[MS4W-Users] Problems with php-mapscript and postgis-layers from different databases

Jeff McKenna jmckenna at gatewaygeomatics.com
Thu Jul 29 06:58:55 EST 2010

Hello Ludwig,

I don't maintain PHPMapScript so I don't have an official answer for 
you.  You might want to send this message to the mapserver-dev email 
list, where the developers live 

My guess though is that once you open a connection with PHP through 
pg_connect, those credentials will always be used by PHP (no matter if 
it is mapscript or whatever) until you close the connection with pg_close.


Jeff McKenna
MapServer Consulting and Training Services

Ludwig Kniprath wrote:
> Hi all,
> following problem:
> I'm using PHP-Mapscript for displaying some postgis-layers. I store 
> geo-data and application-data in different schemas of the same database 
> and had no problems so far.
> For storing OpenStreetMap-Data I tried to use another database ('osm') 
> and configured my mapfile-layer with "CONNECTION ... dbname=osm...", but 
> the data didn't render so far.
> Setting "DEBUG 5" at layer-level showed the reson for this behaviour:
> Although the layer was defined with
> <SNIP>
> CONNECTION "user=postgres password=postgres dbname=gis host=localhost 
> port=5432"
> </SNIP>
> the log-file says:
> <SNIP>
> [Wed Jul 28 15:16:08 2010].429000 msPostGISLayerOpen: No connection in 
> pool, creating a fresh one.
> [Wed Jul 28 15:16:08 2010].507000 
> msConnPoolRegister(planet_osm_line,user='kniprath' 
> password='my_dummy_pw' dbname='wver_ims' host='' 
> port='5432',04E14D88)
> </SNIP>
> Why does PHP-Mapscript ignore the layer-connection-settings in the 
> mapfile and reuses the credentials of the established connection from 
> the calling php-script?
> Regards
> Ludwig

More information about the MS4W-Users mailing list