[mapserver-users] OGR connection failure

Juni Adi skiper at infojawa.org
Fri Mar 6 00:59:07 EST 2009


Hi all,

I've just installed mapserver with php_mapscript enabled on my centos5 :
mapserver-5.2.1
gdal-1.6.0 (configured with mysql)
mysql 5.0.45
PHP 5.2.6

I've been trying to connect to mysql virtual data using mapscript (gmap) 
and failed with following error:
[MapServer Error]: msOGRFileOpen(): Open failed for OGR connection in 
layer `base'. Failed to open datasource 
`MySQL:mapserver,user=xxxx,password=xxxx,tables=base'. in 
/home/infojawa/maps/jawa.inc.php on line 552
 
The error log in error.log (i've set DEBUG 5 in my mapfile) is:
[Fri Mar  6 03:13:38 2009].513694 msOGRFileOpen(base.ovf)...
[Fri Mar  6 03:13:38 2009].513755 
OGROPen(/home/infojawa/maps_data/jawa/base.ovf)
[Fri Mar  6 03:13:38 2009].514373 msOGRFileOpen(): OGR error. Open 
failed for OGR connection in layer `base'.
Failed to open datasource 
`MySQL:mapserver,user=xxxx,password=xxxx,tables=base'.


my ovr file base.ovr:

<OGRVRTDataSource>
     <OGRVRTLayer name='base'>
           
<SrcDataSource>MySQL:mapserver,user=xxxx,password=xxxx,tables=base</SrcDataSource>
<GeometryField encoding="WKT" field="GEOMETRY"/>
<LayerSRS>WGS84</LayerSRS>
</OGRVRTLayer>
</OGRVRTDataSource>

I get sucsessfull connection from shell:

# /usr/bin/ogrinfo base.ovf
ERROR 4: Update access not supported for VRT datasources.
Had to open data source read-only.
INFO: Open of `/home/infojawa/maps_data/jawa/base.ovf'
      using driver `VRT' successful.
1: base


my mapfile:
LAYER
        NAME base
        CONNECTIONTYPE ogr
        CONNECTION "base.ovf"
        TYPE POLYGON
        STATUS ON
        TRANSPARENCY 100
        DEBUG 5

        CLASS
        NAME "base"
            STYLE
            COLOR  221 221 221
            END
      END
END # layer


from phpinfo():
MapServer version 5.2.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP 
OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV 
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_CLIENT 
SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS INPUT=EPPL7 INPUT=OGR 
INPUT=GDAL INPUT=SHAPEFILE

I've been searching arround, and found some similar failure cases, but 
didn't find how these problems solved.
I've even add 'SetEnv LD_LIBRARY_PATH /usr/local/lib' in httpd.conf and 
"CONFIG GDAL_DATA /usr/local/share/gdal" in the mapfile, but didn't help.

Thanks
Junek
ps: In my other box, using ms4w 2.3.1 the same script is running well.



More information about the mapserver-users mailing list