<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Calibri Light";
panose-1:2 15 3 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
h2
{mso-style-priority:9;
mso-style-link:"Heading 2 Char";
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:18.0pt;
font-family:"Calibri",sans-serif;
font-weight:bold;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.Heading2Char
{mso-style-name:"Heading 2 Char";
mso-style-priority:9;
mso-style-link:"Heading 2";
font-family:"Calibri Light",sans-serif;
color:#2F5496;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Map-level metadata lives in the WEB object… <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> MapServer-users <mapserver-users-bounces@lists.osgeo.org>
<b>On Behalf Of </b>Jan Hartmann via MapServer-users<br>
<b>Sent:</b> Monday, October 30, 2023 12:46 PM<br>
<b>To:</b> Vassilis Chatzigiannakis <vchatzi@itml.gr>; mapserver-users@lists.osgeo.org<br>
<b>Subject:</b> Re: [MapServer-users] Docker image for MapServer with PHP-MapScript<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Almost there. There are additional migration examples in: <a href="https://ms4w.com/trac/wiki/MigrationGuide5.x">
https://ms4w.com/trac/wiki/MigrationGuide5.x</a><br>
<br>
<br>
I wrote wrapper functions for the old ms_new... functions, and can create that way a new mapObj called $oMap.
<br>
<br>
The "set" function has been renamed to "__set" : not $oMap->set("maxsize",6020), but: ;$oMap->__set("maxsize",6020);<br>
<br>
Layers can be declared as before: $layer = $oMap->getLayer(1). <br>
<br>
Metadata have to be set as follows:<br>
<br>
Not: $layer->setMetadata("...","..."); but: $layer->metadata->set("...","...")<br>
<br>
However, I cannot set the metadata of the mapObj: $oMap->metadata->set("...","...") gives: "<span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:black">Undefined array key "metadata""</span><br>
<br>
<span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:black">Any idea?<br>
<br>
</span><o:p></o:p></p>
<div>
<p class="MsoNormal">On 29/10/2023 07:52, Vassilis Chatzigiannakis wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Yes the documentation is a mess .<o:p></o:p></p>
<p class="MsoNormal">I worked with this reference:<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><a href="https://mapserver.org/mapscript/mapscript-api/index.html">https://mapserver.org/mapscript/mapscript-api/index.html</a><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">So, you start by <o:p></o:p></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:Consolas;color:#9CDCFE">$oMap</span><span style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4"> =
</span><span style="font-size:10.5pt;font-family:Consolas;color:#569CD6">new</span><span style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4">
</span><span style="font-size:10.5pt;font-family:Consolas;color:#4EC9B0">mapObj</span><span style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4">(</span><span style="font-size:10.5pt;font-family:Consolas;color:#9CDCFE">$mapfile</span><span style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4">);</span><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Best regards,<o:p></o:p></p>
<p class="MsoNormal">Vassilis<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Jan Hartmann <a href="mailto:j.l.h.hartmann@gmail.com">
<j.l.h.hartmann@gmail.com></a> <br>
<b>Sent:</b> Saturday, October 28, 2023 9:14 PM<br>
<b>To:</b> Vassilis Chatzigiannakis <a href="mailto:vchatzi@itml.gr"><vchatzi@itml.gr></a>;
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [MapServer-users] Docker image for MapServer with PHP-MapScript<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">This seems to work. And it says so in the migration guide (<a href="https://mapserver.org/mapscript/php/migration_guide.html">https://mapserver.org/mapscript/php/migration_guide.html</a>):<br>
<br>
<span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:#3E4349;background:white">all of your PHP scripts (that leverage MapServer objects and functions) must now always first include the generated <cite><span style="font-family:"Arial",sans-serif">mapscript.php</span></cite> file
containing MapServer constants:</span><br>
<br>
But could it be that only "$m = new mapObj('...');" is accepted, and "$m=ms_newMapObj('...');" isn't? The docs still mention the old call (<a href="https://mapserver.org/mapscript/php/phpmapscript.html">https://mapserver.org/mapscript/php/phpmapscript.html</a><o:p></o:p></p>
<div>
<p class="MsoNormal">On 28/10/2023 09:11, Vassilis Chatzigiannakis wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi, <o:p></o:p></p>
<p class="MsoNormal">I did it recently. There should be a mapscript.php file in the same folder as the php_mapscriptng.so extension.<o:p></o:p></p>
<p class="MsoNormal">You need to include it in your php script.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Best,<o:p></o:p></p>
<p class="MsoNormal">Vassilis<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> MapServer-users <a href="mailto:mapserver-users-bounces@lists.osgeo.org">
<mapserver-users-bounces@lists.osgeo.org></a> <b>On Behalf Of </b>Jan Hartmann via MapServer-users<br>
<b>Sent:</b> Friday, October 27, 2023 9:42 PM<br>
<b>To:</b> <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [MapServer-users] Docker image for MapServer with PHP-MapScript<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I made a docker version of mapserver/php-mapscript myself, based on Ubuntu 22.04. I installed all required libraries with apt, and compiled mapserver and mapscript according to instructions. No problem at all.<br>
<br>
At the end I got the following from phpinfo();<br>
<br>
<br>
<br>
<br>
<o:p></o:p></p>
<h2 align="center" style="text-align:center;background:white"><a name="module_mapscript"><span style="font-size:15.0pt;font-family:"Arial",sans-serif;color:#222222">mapscript</span></a><span style="mso-bookmark:module_mapscript"></span><o:p></o:p></h2>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="934" style="width:700.5pt;background:white;border-collapse:collapse;box-shadow: rgb(204, 204, 204) 1px 2px 3px;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;word-spacing:0px">
<tbody>
<tr>
<td width="300" valign="bottom" style="width:225.0pt;border:solid #666666 1.0pt;background:#CCCCFF;padding:3.0pt 3.75pt 3.0pt 3.75pt">
<p class="MsoNormal" style="mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<b><span style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#222222">MapServer Version</span></b><o:p></o:p></p>
</td>
<td valign="bottom" style="border:solid #666666 1.0pt;border-left:none;background:#DDDDDD;padding:3.0pt 3.75pt 3.0pt 3.75pt;overflow-x: auto;overflow-wrap: break-word">
<p class="MsoNormal" style="mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<span style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#222222">MapServer version 8.0.1 PROJ version 9.3 GDAL version 3.4 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=OGCAPI_SERVER SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
But no mapscript function or object was regognized in my PHP-scripts:<br>
<br>
PHP Fatal error: Uncaught Error: Class "mapObj" not found in /virdir/www_root/test.php:2<br>
Stack trace:<br>
#0 {main}<br>
thrown in /virdir/www_root/test.php on line 2<br>
<br>
<br>
I am really desparate. Has anyone ever succeeded to get php_mapscriptng.so to work? Or does anyone know of a working Docker image for MapServer with PHP MapScript?<br>
<br>
Jan<o:p></o:p></p>
<div>
<p class="MsoNormal">On 21/10/2023 05:40, Jan Hartmann wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt">I tried this with serveral versions of PHP and MapServer, but got always the same result. Can anyone point me to a Docker image for MapServer + PHP-MapScript?<br>
<br>
Jan<o:p></o:p></p>
<div>
<p class="MsoNormal">On 19/10/2023 18:12, Jan Hartmann wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt">Still not there. Everything has been installed, and phpinfo() gives:<o:p></o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="934" style="width:700.5pt;background:white;border-collapse:collapse;box-shadow: rgba(0, 0, 0, 0.2) 1px 2px 3px;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;word-spacing:0px">
<tbody>
<tr>
<td width="300" valign="bottom" style="width:225.0pt;border:solid #666666 1.0pt;background:#CCCCFF;padding:3.0pt 3.75pt 3.0pt 3.75pt">
<p class="MsoNormal" style="mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<b><span style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#222222">MapServer Version</span></b><o:p></o:p></p>
</td>
<td valign="bottom" style="border:solid #666666 1.0pt;border-left:none;background:#DDDDDD;padding:3.0pt 3.75pt 3.0pt 3.75pt;overflow-x: auto;overflow-wrap: break-word">
<p class="MsoNormal" style="mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<span style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#222222">MapServer version 8.0.1 PROJ version 9.3 GDAL version 3.7 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=OGCAPI_SERVER INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><br>
But calling "$map = new mapObj('mapfile.map');" gives: <br>
<br>
<b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:black">Fatal error</span></b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:black">: Uncaught Error: Class "mapObj" not found in /mnt/virdir/www_root/test/test_mapscript.php:2
Stack trace: #0 {main} thrown in <b>/mnt/virdir/www_root/test/test_mapscript.php</b> on line <b>2<br>
<br>
</b></span>Any idea?<br>
<br>
Jan<o:p></o:p></p>
</blockquote>
<p class="MsoNormal"> <o:p></o:p></p>
</blockquote>
<p class="MsoNormal"> <o:p></o:p></p>
</blockquote>
<p class="MsoNormal"> <o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>