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

Ludwig Kniprath ludwig at kni-online.de
Thu Jul 29 13:54:01 EST 2010


Hi,
thanks a lot, I finally found my fault.

One of the many rows in my script was:
<SNIP>
$map_file_layer_object->set('connection', $postgres_connection_string);
</SNIP>

Because of that php-mapscript did not use the credentials from the 
mapfile, without that line everything works as expected.

Sorry for my noise...

Ludwig

BTW:
I use MapServer 5.6.3 from "MS4W Base Installer v3.0 Beta 11" and am 
very grateful for the great software and your kind support!


Am 29.07.2010 20:12, schrieb Daniel Morissette:
> Jeff McKenna wrote:
>    
>> 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.
>>
>>      
> I see no reason why MapServer would (or even could) reuse a connection
> already established by the calling PHP Script.
>
> I'd suggest you double-check to make sure your mapfile does not contain
> the wrong connection string in one of your layers, and that your script
> does not happen to override the layer->connection value for one of your
> layers, and if that's not the source of the problem then you'll have to
> share a small test case (PHP script + mapfile), ideally with a single
> layer definition in it that reproduces the problem and that can be used
> to identify and fix it.
>
> BTW, which version of MapServer are you using?
>
> Daniel
>    



More information about the MS4W-Users mailing list