Warning: include(C:/ms4w/apps/phpmapscriptng-swig/include/mapscript.php): Failed to open stream: No such file or directory in C:\ms4w\apps\ms-ogc-workshop\sld\OGC_SLD_mapfileclasses2sld.php on line 20

Warning: include(): Failed opening 'C:/ms4w/apps/phpmapscriptng-swig/include/mapscript.php' for inclusion (include_path='.;\ms4w\Apache\php') in C:\ms4w\apps\ms-ogc-workshop\sld\OGC_SLD_mapfileclasses2sld.php on line 20
MapServer OGC:SLD Example
MapServer OGC:SLD Example

Input Mapfile
Mapscript code:
// load mapscript
dl("php_mapscript.dll");

// required SWIG include (contains constants for PHP7)
include("C:/ms4w/apps/phpmapscriptng-swig/include/mapscript.php");

// instantiate a new Map Object
// with the mapfile as an argument
$oMap = new mapObj("C:/ms4w/apps/ms-ogc-workshop/sld/demo.map");

// generate an SLD into a string variable
$sldString = $oMap->generatesld();

// print out the SLD
// or do whatever with it
echo $sldString;
					
Output OGC:SLD Document