= Important notes when upgrading to MS4W 5 from MS4W 4 = [[PageOutline]] == REQUIREMENTS.txt == * always first follow the instructions in the file ''/ms4w/REQUIREMENTS.txt'' to install the updated "Microsoft Visual C++ Redistributable" on your server == SWIG !MapScript == === PHP === * test PHP !MapScript at the commandline by executing: {{{ setenv.bat php -dextension=C:/ms4w/Apache/php/ext/php_mapscript.dll -r "echo msGetVersion();" }}} * as of MS4W 5.0, there is '''no external file to include''' in your PHP scripts (the constants and functions are wrapped inside the !MapScript PHP extension instead) * see the updated example scripts here on the Wiki, such as: * query example: [[SWIGMapScriptQuery|MS4W 5.x]] * new layer example (WMS layer, polygon + opacity, point): [[SWIGMapScriptNewLayer|MS4W 5.x]] * WMS wrapper example: [[WMSWrapper|MS4W 5.x]] * setOpacity() example: [[SWIGMapScriptOpacity|MS4W 5.x]] * ''quickmap.php'' has also been updated (see locally at ''/ms4w/Apache/htdocs/quickmap.php'') * be aware that with the !MapServer 8 release, many '''deprecated''' things have been removed and will now throw an error. For example, there is no longer a ''setMetaData()'' function for a Layer, in [[https://mapserver.org/mapscript/mapscript.html|SWIG MapScript]]. Instead here is a working example: {{{ #!php metadata->set("wms_name", "popplace"); $oWMSLayer->metadata->set("wms_srs", "EPSG:3978"); $oWMSLayer->metadata->set("wms_server_version", "1.1.1"); $oWMSLayer->metadata->set("wms_format", "image/png"); ?> }}} === Python === * test Python !MapScript at the commandline by executing: {{{ setenv.bat python -c "import mapscript; print (mapscript.msGetVersion())" }}} * ''quickmap.py'' has been included in ''/ms4w/msplugins/mapscript/python/'' (follow the instructions at top of file) * the GDAL Python utilities can be called at the commandline such as: {{{ setenv.bat gdal_merge --help gdal2tiles --help }}} == PROJ == * Apache's conf & setenv.bat now set PROJ_LIB to PROJ's new location: {{{ \ms4w\share\proj;\ms4w\share\proj\grids }}} If your mapfiles set a PROJ_LIB (which is not recommended, as MS4W's Apache does this for you) you will have to update your PROJ_LIB value * MS4W 5.0 includes PROJ 8.2, which contains many changes, allowing to dynamically pull in various grids, to improve accuracy * see settings in ''/ms4w/share/proj/proj.ini'' * since we are involved in displaying maps over the internet, we should likely have these grids locally on the server * execute the following to install the grids (into /ms4w/share/proj/) {{{ setenv.bat proj-install-grids.bat }}} == Removed Mapfile Parameters == The following (formerly deprecated) mapfile parameters will now cause errors in your mapfile, you '''MUST REMOVE''' them: 1. '''DUMP TRUE''' Instead, you can configure querying of your layer by using METADATA instead, such as: {{{ LAYER ... METADATA "wms_title" "Populated Places" "wms_include_items" "all" "gml_include_items" "all" "gml_featureid" "ogc_fid" END #metadata ... END #layer }}} 2. '''OPACITY at the LAYER-level''' Instead it must be inside a [[https://mapserver.org/mapfile/composite.html|COMPOSITE]] object: {{{ LAYER ... COMPOSITE OPACITY 40 END #composite END #layer }}} 3. '''COLOR at the LAYER-level''' Instead it must be inside a [[https://mapserver.org/mapfile/style.html|STYLE]] object: {{{ LAYER ... STYLE COLOR 120 120 120 END #style END #layer }}} == map2img ==